What is the algorithm used by freqz?

2 views (last 30 days)
Fernando
Fernando on 8 Jul 2011
I have taken a look at the help pages of fft and frezq but I am still unclear.
The function fft computes a DFT fast; if I fft a sinusoid whose frequency is an multiple of 1/N (where N is the signal length) I get back a N-length signal that contains two bins equal to N/2 while all other bins contain quantization noise. Now, if I freqz the same signal with N points, I get spectral leakage all around the place. For example,
cos_signal = cos(2*pi*[0:1:1023]/8); h1=fft(cos_signal); plot(20*log10(abs(h1)/max(abs(h1))));
Gives a spectrum with two discrete deltas, and zero (ie quantization error), everywhere else.
If I call freqz(cos_signal), which supposedly uses 512 frequency points, I get the same thing as with fft (even though the fft was a 1024 point fft). However, if I call freqz(cos_signal,1,1024), I get spectral leakage.
I would appreciate an explanation with the implementation details of freqz.
Thanks,
Fernando.

Answers (1)

Paulo Silva
Paulo Silva on 8 Jul 2011
edit freqz
and see how it works

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!