i need some guidance with understanding frequency response characteristics.

i have the a signal A with is played on speakers and recorded via microphone which is signal B. then i apply a window function, shift both signals to frequency domain and analyze the magnitudes, but the peak for the most dominant frequency is not at nearly the same index. it jumps.

to do further analyzation of the signal my plan was to create the frequency response of my audio system, multiply my frequency domain signal A with the FR and the peaks should align.
am i roughly right with this?

if yes, additional question:
as my processing power is limited i want to analyze only a certain frequency band. what would be the best approach to generate an frequency response for a certain frequency band? and if i consider only a few frequencies, is it possible, that other frequencies outside my "scope" affect my observed ones and make my results unpredictable again?

thanks for any help in advance! cheers

  • 1
    $\begingroup$ When you say "the peak for the most dominant frequency is not at nearly the same index" you mean that you're observing a frequency shift? This could happen if your system is nonlinear (overdriven microphone) or the microphone is moving fast (Doppler shift). If neither is the case, there's probably something wrong with your analysis. Do A and B have the same length? $\endgroup$ – Deve Dec 18 '12 at 9:23
  • 1
    $\begingroup$ In addition to what Deve said, what does the signal you're playing look like? Is it a pure tone, voice, some modulated sinusoid, etc.? $\endgroup$ – Jason R Dec 18 '12 at 14:12
  • $\begingroup$ @JasonR its music in signal A which is recorded after playback into signal B $\endgroup$ – Maximilian Körner Dec 18 '12 at 22:05
  • $\begingroup$ @Deve so you say the main frequency pattern should remain the same if i dont have one of the 2 mentioned problems? now you say that i see, that my dominant frequencies in A are mostly in very low frequencies and most likely my very small speaker (mono) isnt able to reproduce this frequencies and others become more dominant in recorded B? $\endgroup$ – Maximilian Körner Dec 18 '12 at 22:08
  • $\begingroup$ The frequency spectrum of A might be changed by a linear system, of course. What you describe in your last comment is most probably the effect of the transfer functions of speaker and microphone that can be described by linear systems. $\endgroup$ – Deve Dec 19 '12 at 8:13

Let's assume that speaker, free space and microphone can be modeled as linear systems and that the overall system transfer function is given by $H(\omega)$. Then the received signal is given by $$ B(\omega) = A(\omega)H(\omega), $$ where $A(\omega)$ is the signal sent to the speaker. So, yes, if you know the transfer function $H(\omega)$ you can calculate $B(\omega)$ and it should align with what you record with the microphone.

To determine $H(\omega)$ in practice you will have use discrete-time signals and play a unit impulse $a(n) = \delta(n)$, record the received signal $b(n)$ and calculate the transfer function with help of the discrete Fourier transform (DFT): $$ B(k) = DFT[b(n)] $$ Now the maximum frequency $\omega_m$ you are able to analyze depends on the sampling rate $\omega_s$ with which the samples of $b(t)$ are acquired after the microphone to obtain $b(n)$: $\omega_m = \omega_s/2$. Frequencies greater than $\omega_m$ can neither be measured nor calculated and will influence your result because of the Aliasing effect unless they're filtered with a low pass filter before sampling. An alternative approach is to transmit a signal $A(k)$ that only contains frequencies in the range you're interested. The transfer function for this limited frequency range can then be calculated by $$ H(k) = \frac{B(k)}{A(k)} $$ In this case frequencies lying outside this range won't affect your result as long as it's a linear system.

A comment on processing power: the sampling rate influences the clock rate in a real-time system and doesn't affect complexity otherwise. The cost of the DFT operation (implemented by the FFT algorithm) increases with the length $N$ of the recorded signal $b(n)$. The greater $N$ the greater the frequency resolution of $B(k)$.

  • $\begingroup$ so if i have a samplingrate of 44100, each fft window is 8192 samples equals 4096 bins. so 10 something hz per bin. to calculate the transferfunction for this setup i need a sine sweep of the same samplerate and sampleamount sweeping all my desired frequencies, record this sweep on the microphone and divide sweep/recordedSweep in frequency domain to obtain the frequency response? (with which i should be able to predict the recording by multiplying with my A) $\endgroup$ – Maximilian Körner Dec 20 '12 at 2:43
  • $\begingroup$ @MaximilianKörner Should work, yes. But I see no restrictions on sampling rate and length of the sent test signal. And the frequency response calculates as recordedSweep/transmittedSweep $\endgroup$ – Deve Dec 20 '12 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.