Why am I getting an incorrect filtered signal with the dsp.FIRFilter system object?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 15 de Sept. de 2022
Respondida: MathWorks Support Team
el 30 de Sept. de 2022
Given the following code:
fd = 1/3;
x = [1 zeros(1,1023)]';
[h,i0,bw] = designFracDelayFIR(fd);
fdf = dsp.FIRFilter(h);
y_actual = fdf(x);
y_expected = filter(h,1,x);
Plotting the filtered signals generated by the "filter" function and "dsp.FIRFilter" object (in the DSP System Toolbox) in MATLAB R2021b result in the plot below:
The top plot in the figure represents the filtered signal, ("y_actual") and the bottom plot in the figure represents the filtered signal, ("y_expected"). The bottom figure is what I expect to see, why is the top figure (using the "dsp.FIRFilter" object) incorrect?
Respuesta aceptada
MathWorks Support Team
el 15 de Sept. de 2022
To obtain the same output with the "dsp.FIRFilter" object and "filter" function, the input needs to be provided as a column vector:
>> x = [1 ones(1,1023)]';
With system objects and blocks in DSP System Toolbox, each column of input is considered to be a separate channel. If the input is provided as a row vector, the "dsp.FIRFilter" object considers it to be an input of frame size 1 and number of channels as 1024 and processes each channel separately which is why you previously get an output vector with all values as the same.
For more details, you can refer to https://www.mathworks.com/help/dsp/index.html?s_tid=hc_product_card
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Single-Rate Filters en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!