Multiply input directly to the tranfer function/frequency response

Thread Starter

jag1972

Joined Feb 25, 2010
71
Hello All,
Wanted to ask you for some advice as I am a little stuck on a 1st order FIR low pass filter question

If the following input signal (which is made up of 2 components) is applied to the low pass filter:

\(x(t) = 5 + 12cos(20 \pi t) \)

\( H(e^{j\omega})=\frac{1+e^{-j\omega}}{2}\)

Using superposition the out signal can be determined. If we assume that \( Fs=40 Hz \) ,

\(x(t) = 5 + 12cos [\frac {2 \pi 10 }{40}] \)

\(x[n] = 5 + 12cos [\frac {\p}{2} n] \)

Output in discrete time is equal to the magnitude and phase response at both frequencies i.e.

\( \omega 1 = 0\) and \( \omega 2 = \frac{\pi}{2}\)

\( H(e^{j\omega 1})=\frac{1+e^{-j0}}{2}\)

\( |H(e^{j\omega 1})|= 1\)



\(\angle e^{j\omega1} = 0 degrees\)

\( H(e^{j\omega 2})=\frac{1+e^{-j\frac{\pi}{2}}}{2}\)

\( |H(e^{j\omega 2})|= \frac{1}{\sqrt{2}}\)

\(\angle e^{j\omega2} = -45 degrees\)


\(y[n] = | H(e^{j\omega 1})|*5 + | H(e^{j\omega 2})|*12cos [\frac {\p}{2} n - \angle e^{j\omega 2} \)

\(y[n] = 5 + \frac{1}{\sqrt{2}}*12cos [\frac {\p}{2} n - \frac{\pi}{4} \)

My question is how can I prove this, in MATLAB and/or on paper. These are the 2 ways I think

1) Determine the impulse response from the transfer function, I thinks its \( h[n] = \frac {1}{2}, \frac{1}{2} \), then using circular convolution to determine y[n].

2) Take the Z transform of the input signal, then multiply the 2 and take the inverse z transform.

I have used sptool in MATLAB, however failed to proove it that as well.

Sadly I can not do it using any of the 3 methods, hopefully I am not to far away from the solution.
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Check the impulse response is correct. The discrete seqúénce starts at n=0.

\(h[n] = \frac{1}{2}, \frac{1}{2} \)

If we take the Z transform of this impulse response, we get:

\(H[Z] = \frac{1}{2} Z^{0} + \frac{1}{2} Z^{-1} \)

\(H[Z] = \frac{1}{2}(1 + Z^{-1}) \)

Attempt at a solution is to take the Z transform of the input signal which is in discrete time

\(x(nT)= 50 + 20*cos( \frac{\pi}{2})\)

\( X(Z) = \frac{50}{1+Z^{-1}} + \frac{20}{1+z^{-2}\)

Y(Z)= X(Z).H(Z)

\( Y(Z) = \frac{25(1+Z^{-1})}{1+Z^{-1}} + \frac{10(1+Z^{-1})}{1+z^{-2}\)

\( Y(Z) = 25 + \frac{10(1+Z^{-1})}{(1+jZ^{-1})(1-jZ^{-1})\)

The next part would be to use the partial fraction expansion method to determine inverse Z Transform

\( \frac{10(1+Z^{-1})}{(1+jZ^{-1})(1-jZ^{-1}) \) \(= \frac{A}{1+jZ^{-1}} + \frac{B}{1-jZ^{-1} \)

\( 10(1+Z^{-1}) \) \(= A(1-jZ^{-1}) + B(1+jZ^{-1}) \)

By my calculations this makes A = 5 + 5j and B = 5+5j

\( Y(Z)= 25+ \frac{5+5j}{1+jZ^{-1}} + \frac{5+5j}{1-jZ^{-1} \)

Am I going on the right tracks here?
 

mlv

Joined Nov 6, 2017
17


My question is how can I prove this, in MATLAB and/or on paper. These are the 2 ways I think


If you want to do "proof-by-Matlab" by showing that some reasonable number of samples match the steady-state response above, then you can do the following:

>> N = 100;
>> ytheor = 5*ones(N,1) + 1/sqrt(2)*12*cos(pi/2*(0:N-1)'-pi/4);
>> x = 5*ones(N,1)+12*cos(pi/2*(0:N-1)');
>> y = conv(0.5*[1 1],x);
>> plot(ytheor-y(1:N))
>> norm(ytheor(2:end)-y(2:N))/norm(ytheor(2:end))
ans = 3.6554e-15

In this case, all but the start-up transient match your steady-state equation. As you mentioned, you can do circular convolution and avoid the startup.

From a standard-difference equation standpoint, you can start with

y[n] = 0.5*x[n] + 0.5*x[n-1]

...and continue until you get your frequency-response-derived equation - something along these lines (may have some typos as I derive on the fly):

y[n] = 0.5*(5+12*cos(n*pi/2)) + 0.5*(5+12*cos((n-1)*pi/2))
= 5 + 12/2*(cos(n*pi/2)+sin(n*pi/2))
= 5 + 12/2*[1/2*(exp(j*n*pi/2)+exp(-j*n*pi/2)) + 1/(2*j)*(exp(j*n*pi/2)-exp(-j*n*pi/2))]
= 5 + 12/2*[1/2*(1-j)*exp(j*n*pi/2) + 1/2*(1+j)*(exp(-j*n*pi/2))]
= 5 + 12/2*[1/2*sqrt(2)*exp(j*(n*pi/2-pi/4)) + 1/2*sqrt(2)*exp(-j*(n*pi/2-pi/4))]
= 5 + (12/2)*sqrt(2)*cos(n*pi/2-pi/4)
 
Top