0
$\begingroup$

I have an audio signal

SampleRate Fs: 44100 Hz

TotalSamples: 94144 samples

Duration t: 2.1348 s

The frequency resolution is given by Fs/N where FS is the input signal's sampling rate and N is the number of FFT points used.

If I want to have 10Hz frequency resolution (bins of 10Hz), I should use 4410 FFT-points (44100/4410 = 10) but fft(signal,N) function of matlab specifies that N (4410 in my case) should greater than the signal length (94144 in my case). How should I proceed?

$\endgroup$
  • $\begingroup$ Hmm. That should have worked. I don't see any reason why not. The documentation clearly says that N can be less than the length of the signal. Suggest that you post the exact code that you used and the exact error message that you received (any red text). You can also try fft(signal(1:4410)), as that is essentially all that matlab does internally if N is less than the length of the signal. $\endgroup$ – Daniel Kiracofe May 18 '17 at 2:07
  • $\begingroup$ If I got your question right you are willing to decrease the resolution as you are now getting (44100/94144) resolution FFT and you need just to have 10 Hz frequency resolution $\endgroup$ – Zeeshan May 18 '17 at 9:59
2
$\begingroup$

There are some important clarifications out of this question that are good to point out:

The frequency resolution of a block of data is 1/T where T is the length of the data in time (in seconds). Since the sampling rate and block length are related as

$T = N/f_s$

Where $f_s$ is the sampling rate, it follows that the frequency resolution for a block of N samples will be $1/T = f_s/N$.

Zero padding does not change the frequency resolution, it only interpolates more samples of the Discrete Time Fourier Transform. See these posts:

What happens when N increases in N-point DFT

What proportion of a padded FFT should be actual values

When you do fft(signal,N) in Matlab, N must be larger or equal to the signal length and when larger it will simply append zeros, so identical to zero padding.

So to achieve a 10 Hz resolution bandwidth, you either need to reduce the number of samples, as in fft(sig(1:m)), or reduce the sampling rate, but regardless of sample rate, the length of the block in your fft must be 1/10 = 0.1 seconds long.

Note that windowing if performed will expand the frequency resolution; the finest resolution is achieved with no windowing and is $f_s/N$

Refer to this paper by fred harris which details the resolution bandwidth for various windows: fred harris on the use of windowing

$\endgroup$
  • $\begingroup$ Nicely summarized $\endgroup$ – Zeeshan May 19 '17 at 7:52

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.