FFT filter problemnot consistent responce (fdesign.arbgrpdelay)
Mostrar comentarios más antiguos
Dear all,
Can someone please help me with fdesign.arbgrpdelay?
I am using the following code which is more or less(with a few changes) what is given as a demonstration code for fdesign.arbgrpdelay:
clear all
x = zeros(300,1);
x(1:36) = cos(pi/2*(0:35)).*hamming(36)';
x(40:40+39) = cos(pi/4*(0:39)).*hamming(40)';
N = 18;
f = 0:.1:1;
gd = ones(size(f));
gd(1) = 100;
gd(3)=100;
gd(10)=90;
gd(7)=76;
gd(1) = 63;
gd(9)=15;
gd(2)=10;
gd(11)=100;
d = fdesign.arbgrpdelay(N,f,gd);
Hd = design(d,'iirlpnorm','MaxPoleRadius',0.9);
fvtool(Hd,'analysis','grpdelay');
y = filter(Hd,x);
subplot(211)
plot(x); title('Input Signal');
grid on; ylabel('Amplitude');
subplot(212);
plot(y); title('Output Signal'); grid on;
xlabel('Samples'); ylabel('Amplitude');
figure
plot(fftshift(abs(fft(x))))
title('input fft')
figure
plot(fftshift(abs(fft(y))))
title('output fft')
While I should get (as I understand a distorted waveform even in the frequency domain) I get two identical both for input and output.As you can see the time domain waveforms have changed.Is that a bug should i stop trying?
Respuestas (1)
Honglei Chen
el 4 de Sept. de 2012
0 votos
Hi George,
You designed an arbitrary group delay filter, so there is no frequency content change. What it does is to delay different frequency components in the signal by the corresponding group delay. If you look at the result of fvtool, (the first figure you get), and check the magnitude response, you can see that the magnitude response is always 1, i.e., an all pass filter. Because you are only plotting the magnitude of FFT, the group delay information is irrelevant there. If you want to see the difference in the frequency domain, you have to plot the phase of FFT.
Categorías
Más información sobre Digital and Analog Filters en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!