Non-causal filter coefficients

Hi all I need to write filter coefficients for the following filter: y(n) = (-x(n+4) - x(n+3) - x(n+2) - x(n+1) + 9x(n) - x(n-1) % - x(n-2) - x(n-3) - x(n-4))
As you can see, the output uses future inputs. I've done causal filters no problem, but am a bit lost with this one.
Any help would be appreciated!

 Accepted Answer

Honglei Chen
Honglei Chen on 16 Mar 2011
Hi Des,
The non-causal filter is not physically realizable. However, if you do a variable replacement of m=n+4, your equation becomes causal and you can then use all the techniques available for the causal filers.
One way to think about this equation is that, you do not get an appropriate output until you have 4 samples in the pipeline. So your output is delayed by 4 samples. In real applications, if you are starting the filter for the first time, you can discard the first four output samples.
HTH,
Honglei

6 Comments

Hi Honglei, Thanks so much for your reply. Excuse my ignorance, but how would I go about getting the filter coefficients using m in place of n+4 ?
Previously, I used something like this to get the filter:
a = 1;
b = [1/4 1/4 1/4 1/4];
y = filtfilt(b, a, x);
Hi Des, the coefficients b and a defines your filter. If you replace n+4 with m, your equation becomes
y[m-5] = -x(m)-x(m-1)-x(m-2)-x(m-3)-x(m-4)+9*x(m-5)-x(m-6)-x(m-7)-x(m-8)-x(m-9)
So your b is [-1 -1 -1 -1 9 -1 -1 -1 -1] and a is 1.
HTH.
Thank you Honglei, I get it now. The filter will just be delayed then ?
Would:
a=1;
b=[-1 -1 -1 -1 9 -1 -1 -1 -1];
not correspond to y(n) = -x(n) - x(n-1) - x(n-2) - x(n-3) + 9x(n-4) - x(n-5) - x(n-6) - x(n-7) - x(n-8) ?
It is. The difference between the two is the delay in the output. In terms of filtering operation, there is no difference. In both systems, you grab 9 samples and then do a linear combination with them.
In this case, the phase will be non-zero. What you expect for a symmetric filter across 0 is that phase is constant (0). Since we are shifting the output, the phase will be a function of delay (a straight line with negative slope proportional to delay).

Sign in to comment.

More Answers (0)

Tags

Asked:

Des
on 16 Mar 2011

Community Treasure Hunt

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

Start Hunting!