summaryrefslogtreecommitdiff
path: root/716/CH9/EX9.7
diff options
context:
space:
mode:
Diffstat (limited to '716/CH9/EX9.7')
-rwxr-xr-x716/CH9/EX9.7/Solved_Ex9_7.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/716/CH9/EX9.7/Solved_Ex9_7.sce b/716/CH9/EX9.7/Solved_Ex9_7.sce
new file mode 100755
index 000000000..40180ea48
--- /dev/null
+++ b/716/CH9/EX9.7/Solved_Ex9_7.sce
@@ -0,0 +1,25 @@
+//Determine the Response of LTI system if input x(n)={-1 1 2 1 -1} and impulse Response h(n)={-1 1 -1 1}
+clc;
+clear;
+x=[-1 1 2 1 -1];
+disp(x,'Input signal=> x(n)=');
+h=[-1 1 -1 1];
+disp(h,'Impulse Response=> h(n)=');
+k=length(x)+length(h)-1;
+for n=length(x)+1:1:k
+ x(n)=0;//appending 0s
+end
+for n=length(h)+1:1:k
+ h(n)=0;//appending 0s
+end
+n=0:1:k;
+
+X=fft(x);
+disp(X,'4 point FFT of x(n)=>');
+
+H=fft(h);
+disp(X,'4 point FFT of h(n)=>');
+
+Y=X.*H;
+y=ifft(Y);
+disp(y,'Response to input,x(n)=> y(n)='); \ No newline at end of file