triquent
Full Member level 3
freqz matlab
I am trying to use the freqz function in matlab to plot an FIR filter (coefficient b=[.5 .5 .5 .5])magnitude and phase response. I tried two different method to plot the magnitude, but I got different results. anything wrong?
1) directly use freqz(b,1) , it automatically plot both of magitude in db and phase.
2)I use [h,w]=freqz(b,1)
plot(w, 20*log(abs(h)))
For these two methods, I got different magnitude plot. What's wrong with my code?
I suppose they will get same plot.
I am trying to use the freqz function in matlab to plot an FIR filter (coefficient b=[.5 .5 .5 .5])magnitude and phase response. I tried two different method to plot the magnitude, but I got different results. anything wrong?
1) directly use freqz(b,1) , it automatically plot both of magitude in db and phase.
2)I use [h,w]=freqz(b,1)
plot(w, 20*log(abs(h)))
For these two methods, I got different magnitude plot. What's wrong with my code?
I suppose they will get same plot.