dsp.FIRRateConverter has unexpected results

1 visualización (últimos 30 días)
Andy
Andy el 30 de Jun. de 2017
Comentada: Honglei Chen el 6 de Jul. de 2017
I am trying to resample a complex signal and the output of the filter is not what I expect. I expect the output of the following example to be a smooth complex sinusoid, but it seems to have misaligned samples.
filt = dsp.FIRRateConverter;
filt.InterpolationFactor = 8;
filt.DecimationFactor = 2;
x = exp(1i * 2 * pi * [1:100] * 1 / 10).';
y = step(filt,x);
figure(1);plot(real(x))
figure(2);plot(real(y(:)))

Respuesta aceptada

Andy
Andy el 5 de Jul. de 2017
Editada: Andy el 6 de Jul. de 2017
It works for those particular values, but I need to work with a range of values. Here's a better example of the problem. Notice that the "resample" function works properly, but for my primary application I am required to use the "dsp" object, which has the problem.
filt = dsp.FIRRateConverter;
filt.InterpolationFactor = 8;
filt.DecimationFactor = 5;
x = exp(1i * 2 * pi * [1:100] * 1 / 10).';
y = step(filt,x);
z = resample(x,filt.InterpolationFactor,filt.DecimationFactor);
figure(1);
subplot(3,1,1);plot(real(x))
subplot(3,1,2);plot(real(y(:)))
subplot(3,1,3);plot(real(z))
  1 comentario
Honglei Chen
Honglei Chen el 6 de Jul. de 2017
In this case, the default filter (see documentation) is not suitable since the cutoff is too high and it introduces the aliasing. Change the filter to
filt.Numerator = firpm(70,[0 0.125 0.2 1],[1 1 0 0]);
and you'll see the right result. However, it also has some group delay effect in it.
The resample designs the filter for you and compensate for the group delay, but it does not work if you have streaming data. That's probably the tradeoff.
HTH

Iniciar sesión para comentar.

Más respuestas (1)

Honglei Chen
Honglei Chen el 1 de Jul. de 2017
Is there any reason your up and down converter factor is 8 and 2 instead of 4 and 1? Based on the documentation at
"You must use upsampling and downsampling factors that are relatively prime, or coprime." Changing it to 4 and 1 seems to give reasonable results
HTH

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by