I have frequency response of low pass filter
M=8 %%%channel
x=8*512
d1=fir1(N-1,wc/pi,w);
% L=length(d1);
% for k=1:L
% b2(k)=((-1)^k)*d1(k);
% end
%%%%%%Frequency response
h1=fft(d1,x);
a1=max(abs(h1));
m1=20*log10(abs(h1/ a1));
c=0:x-1
plot(f1/x,m1)
I have to find magnitude responce at $\omega=\dfrac{\pi}{2M}$ i.e., $h_1$ at $\omega=\dfrac{\pi}{2M}$
Answer
Your code has too many unassigned variables for us to execute it. Your FFT freq axis, in radians/sample, goes from 0 –to- 2pi. The equivalent mathematical FFT integer freq axis index goes from 0 –to- 4095. You want to know h1 at w = pi/(2M) radians/sample. Let's use variable k to represent the mathematical FFT integer index corresponding to your w.
So we can set two ratios equal to each other: k/4096 = w/2pi. Next we write k/4096 = (pi/(2M))/2pi. This gives us k = 4096/(4M) = 4096/32 = 128 as the math index corresponding to your w. Because of Matlab's unpleasant indexing method the magnitude response you want to examine is your h1(k+1) = h1(129) FFT sample. [By the way, as long as your M is an integer power of two, k will be an integer. If M is not an integer power of two, you'll have to use either a 'floor()' or 'ceil()' command to compute the mathematical FFT integer index k.]
No comments:
Post a Comment