I'm given this difference equation, and I'm being asked to plot its response to an input $x[n] = 4\sin^3\left(0.25\pi n+\frac \pi 3\right)u(n)$:
$$ y(n) = 0.9051y(n-1)-0.598y(n-2)+0.29y(n-3)-0.1958y(n-4)+0.207x(n)+0.413x(n-2)+0.207x(n-4) $$
Using MATLAB's filter
function, I implemented the following code:
num = [1 -0.9051 0.598 -0.29 0.1958];
den = [0.207 0 0.413 0 0.207];
x = 0:75; b1 = sin(0.25*pi*x+pi/3);
for i = 1:length(b1) sincub(i) = b1(i)*b1(i)*b1(i); end
inp = 4*sincub; z = filtic(num, den, [0 0 0 0]);
y = filter(num, den, inp, z);
stem(x, y, 'linewidth', 2);grid on
xlabel('Time-index, n'); ylabel('Amplitude'); title('Response to x(n)');
The plot of the input function is attached and so is the response.
The problem I'm facing is that I'm being asked to find the steady-state value of the output when the output appears rather periodic in nature (if x = 1:100
or 1:200
this will be clearer). Where is the transient response in such an output and what can be the steady state? Or is there something wrong in my code?
Any help would be much appreciated.