Output Length of signal filtered using FIR Filters

Technical Source
2 min readMar 9, 2021

--

Hello Experts,

The output of the FIR filters is convolution of the input signal and the filter kernel. In that case, the length of the output signal should be greater than input signal by M-1 points where M is the length of the filter kernel.

x=ecg(500)'+0.25*randn(500,1); %noisy waveform
h=fdesign.lowpass('Fp,Fst,Ap,Ast',0.15,0.2,1,60);
d=design(h,'equiripple'); %Lowpass FIR filter
y=filtfilt(d.Numerator,1,x); %zero-phase filtering
y1=filter(d.Numerator,1,x); %conventional filtering

In the above code, the length of the output is same as the length of my input signal even though I have implemented FIR filtering.

Can someone explain the reason of same length of the output signal? I expected my output signal to be greater than input signal.

Does MATLAB use convolution for filtering?

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

You are correct that if you do convolution, you get a sequence longer than your original signal. However, those extra samples are actually the output due to the internal filter states. I would suggest you to compare the following three results:

x = ones(10,1);
h = ones(10,1);
y1 = conv(h,x);
y2 = filter(h,x);
[y3, zf] = filter(h,x);

You can see that y1 is basically the combination of y3 and zf. It is worth noting that this is only true for a direct form II transposed implementation…..

SEE COMPLETE ANSWER CLICK THE LINK

https://www.matlabsolutions.com/resources/output-length-of-signal-filtered-using-fir-filters.php

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet