Why am I getting an incorrect filtered signal with the dsp.FIRFilter system object?
3 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2022 年 9 月 15 日
回答済み: MathWorks Support Team
2022 年 9 月 30 日
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:
![](http://www.mathworks.com/matlabcentral/answers/uploaded_files/1141515/5c3c754a49524985370d59b1a0221e91.png)
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?
採用された回答
MathWorks Support Team
2022 年 9 月 15 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Single-Rate Filters についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!