summaryrefslogtreecommitdiff
path: root/Digital_Signal_Processing_by_S_Salivahanan
diff options
context:
space:
mode:
Diffstat (limited to 'Digital_Signal_Processing_by_S_Salivahanan')
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/1-Classifications_of_signals_and_systems.ipynb130
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/10-Effects_of_Finite_Word_Length_in_Digital_Filters.ipynb204
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/11-Multirate_Digital_Signal_Processing.ipynb262
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/12-Spectral_Estimation.ipynb101
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/2-Fourier_Analysis_of_Preiodic_and_Aperiodic_Continuous_Time_Signals_and_Systems.ipynb361
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/3-Applications_of_Laplace_Transform_to_System_Analysis.ipynb118
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/4-Z_Transforms.ipynb229
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/5-Linear_Time_Invariant_Systems.ipynb91
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/6-Discrete_and_Fast_Fourier_Transforms.ipynb1000
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/7-Finite_Impulse_Response_Filters.ipynb107
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/8-Infinite_Impulse_Response_Filters.ipynb478
-rw-r--r--Digital_Signal_Processing_by_S_Salivahanan/9-Realisation_of_Digital_Linear_Systems.ipynb116
12 files changed, 3197 insertions, 0 deletions
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/1-Classifications_of_signals_and_systems.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/1-Classifications_of_signals_and_systems.ipynb
new file mode 100644
index 0000000..7f0b972
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/1-Classifications_of_signals_and_systems.ipynb
@@ -0,0 +1,130 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Classifications of signals and systems"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2_a: Rectangular_wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 1.2 (a)\n",
+"clc;clear;\n",
+"t=-5:0.01:5;\n",
+"x=1*(abs(2*t+3)<0.5);\n",
+"plot(t,x);\n",
+"title('x(t)=rect(2t+3)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2_b: Rectangular_wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 1.2 (b)\n",
+"clc;clear;\n",
+"t=-5:0.01:5;\n",
+"x=2*(abs(t-1/4)<0.5);\n",
+"plot(t,x);\n",
+"title('x(t)=2*rect(t-1/4)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2_c: Cosine_wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 1.2 (c)\n",
+"clc;clear;\n",
+"pi=22/7;\n",
+"t=-5:0.01:5;\n",
+"x=cos(2*pi*t-50*pi);\n",
+"plot(t,x);\n",
+"title('x(t)=cos(2*pi*t-*pi)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2_d: Ramp_wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 1.2 (d)\n",
+"\n",
+"clc;clear;\n",
+"t=-5:0.01:5;\n",
+"x=-0.5*(t-4);\n",
+"plot(t,x);\n",
+"title('x(t)=r(-0.5t+2)');\n",
+"zoom_rect([-5 0 5 5]);"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/10-Effects_of_Finite_Word_Length_in_Digital_Filters.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/10-Effects_of_Finite_Word_Length_in_Digital_Filters.ipynb
new file mode 100644
index 0000000..4c69288
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/10-Effects_of_Finite_Word_Length_in_Digital_Filters.ipynb
@@ -0,0 +1,204 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10: Effects of Finite Word Length in Digital Filters"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.2: Output_Quantisation_Noise.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 10.2\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"H=0.5*z/(z-0.5);\n",
+"B=8; \n",
+"pn=2^(-2*B)/12; //Noise power\n",
+"X=H*horner(H,1/z)/z;\n",
+"r=roots(denom(X));\n",
+"rl=length(r);\n",
+"rc=coeff(denom(X))\n",
+"q1=[];q2=[];\n",
+"for n=1:rl //Loop to separate poles inside the unit circle\n",
+" if (abs(r(n))<1) then\n",
+" q1=[q1 r(n)];\n",
+" else\n",
+" q2=[q2 r(n)];\n",
+" end\n",
+"end\n",
+"P=numer(X)/rc(length(rc));\n",
+"Q1=poly(q1,'z');\n",
+"Q2=poly(q2,'z');\n",
+"I=residu(P,Q1,Q2); //Residue Calculation\n",
+"po=pn*I; //Output Noise power\n",
+"disp(pn,'Input Noise power');\n",
+"disp(po,'Output Noise power');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.3: Deadband_Interval.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 10.3\n",
+"\n",
+"clc; clear;\n",
+"//y(n)=0.9y(n-1)+x(n)\n",
+"//Input x(n)=0\n",
+"n=-1;y=12; //Initial Condition y(-1)=12\n",
+"flag=1;\n",
+"while n<8\n",
+" n=n+1;\n",
+" y=[y 0.9*y(n+1)];\n",
+" yr=round(y);\n",
+"end\n",
+"disp(n,'n=');\n",
+"disp(y,'y(n)-exact');\n",
+"disp(yr,'y(n)-rounded');\n",
+"disp([-yr(n+2) yr(n+2)],'Deadband interval ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.4: Deadband_Interval.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 10.4\n",
+"\n",
+"clc; clear;\n",
+"//y(n)=0.9y(n-1)+x(n)\n",
+"a=0.9;\n",
+"l=ceil(0.5/(1-abs(a)));\n",
+"disp([-l l],'Deadband interval ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.5: Output_Quantisation_Noise_for_Cascade_realisation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 10.5\n",
+"\n",
+"clc;clear;close;\n",
+"x=poly(0,'x'); //x=2^-2B\n",
+"z=poly(0,'z');\n",
+"H1=1/(1-0.9/z);\n",
+"H2=1/(1-0.8/z);\n",
+"H=H1*H2; \n",
+"pn=x/12; //Input Noise power\n",
+"\n",
+"//Calculation of output noise for H1(z)\n",
+"X1=H*horner(H,1/z)/z;\n",
+"r1=roots(denom(X1));\n",
+"rc1=coeff(denom(X1));\n",
+"q1=[];s1=[];\n",
+"for n=1:length(r1) //Loop to separate poles inside the unit circle\n",
+" if (abs(r1(n))<1) then\n",
+" q1=[q1 r1(n)];\n",
+" else\n",
+" s1=[s1 r1(n)];\n",
+" end\n",
+"end\n",
+"P1=numer(X1)/rc1(length(rc1));\n",
+"Q1=poly(q1,'z');\n",
+"S1=poly(s1,'z');\n",
+"I1=abs(residu(P1,Q1,S1)); //Residue Calculation\n",
+"po1=pn*I1; //Output Noise power\n",
+"\n",
+"//Calculation of output noise for H2(z)\n",
+"X2=H2*horner(H2,1/z)/z;\n",
+"r2=roots(denom(X2));\n",
+"rc2=coeff(denom(X2));\n",
+"q2=[];s2=[];\n",
+"for n=1:length(r2) //Loop to separate poles inside the unit circle\n",
+" if (abs(r2(n))<1) then\n",
+" q2=[q2 r2(n)];\n",
+" else \n",
+" s2=[s2 r2(n)];\n",
+" end\n",
+"end\n",
+"P2=numer(X2)/rc2(length(rc2));\n",
+"Q2=poly(q2,'z');\n",
+"S2=poly(s2,'z');\n",
+"I2=abs(residu(P2,Q2,S2)); //Residue Calculation\n",
+"po2=pn*I2; //Output Noise power\n",
+"\n",
+"po=po1+po2;\n",
+"disp(pn,'Input Noise power');\n",
+"disp(I1,'I1=');disp(I2,'I2=');\n",
+"disp(po1,'Output Noise power for H1(z)');\n",
+"disp(po2,'Output Noise power for H2(z)');\n",
+"disp(po,'Total Output Noise power');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/11-Multirate_Digital_Signal_Processing.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/11-Multirate_Digital_Signal_Processing.ipynb
new file mode 100644
index 0000000..befae0e
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/11-Multirate_Digital_Signal_Processing.ipynb
@@ -0,0 +1,262 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11: Multirate Digital Signal Processing"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.1: Time_Decimatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 11.1\n",
+"\n",
+"clc;clear;close;\n",
+"x=[0:6 0:6];\n",
+"y=x(1:3:length(x));\n",
+"disp(x,'Input signal x(n)=');\n",
+"disp(y,'Output signal of decimation process by factor three y(n)');\n",
+"subplot(2,1,1);\n",
+"plot2d3(x);title('Input signal x(n)');\n",
+"subplot(2,1,2);\n",
+"plot2d3(y);title('Output signal y(n)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.2: Interpolation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 11.2\n",
+"\n",
+"clc;clear;close;\n",
+"x=0:5;\n",
+"y=[];\n",
+"for i=1:length(x)\n",
+" y(1,2*i)=x(i);\n",
+"end\n",
+"disp(x,'Input signal x(n)=');\n",
+"disp(y,'Output signal of interpolation process with factor two y(n)');\n",
+"subplot(2,1,1);\n",
+"plot2d3(x);title('Input signal x(n)');\n",
+"subplot(2,1,2);\n",
+"plot2d3(y);title('Output signal y(n)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.4: Polyphase_Decompositio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 11.4\n",
+"\n",
+"clc;clear;\n",
+"z=poly(0,'z');\n",
+"num=1-4*z^-1;\n",
+"den=1+5*z^-1;\n",
+"H=num/den;\n",
+"num1=num*(1-5*z^-1);\n",
+"den1=den*(1-5*z^-1);\n",
+"H1=num1/den1;\n",
+"c=coeff(numer(num1));\n",
+"clength=length(c);\n",
+"c=[c zeros(1,pmodulo(clength,2))]; //make length of 'c' multiple of 2\n",
+"c0=[];c1=[];\n",
+"for n=1:ceil(clength/2) //loop to separate even and odd powers of z\n",
+" c0=[c0 c(2*n-1) 0];\n",
+" c1=[c1 c(2*n) 0];\n",
+"end\n",
+"E0=poly(c0,'z','coeff')/z^n/den1;\n",
+"E1=poly(c1,'z','coeff')/z^(n-2)/den1;\n",
+"disp('Polyphase Components')\n",
+"disp(E0,'E0(z)');\n",
+"disp(E1,'E1(z)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.5: Decimator_implementation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 11.5\n",
+"\n",
+"clc;clear;\n",
+"\n",
+"function [N,R]=func(Fs,Fp,Ft,Fti,dp,ds,M)\n",
+" dF=(Fs-Fp)/Ft; //Normalised transition bandwidth\n",
+" N=round((-20*log10(sqroot(dp*ds))-13)/(14.6*dF)); //FIR Filter length\n",
+" R=N*Fti/M; //Number of Multiplications per second\n",
+"endfunction\n",
+"\n",
+"Ft=20000; //Sampling rate of input signal\n",
+"Fp=40; //Passband frequency\n",
+"Fs=50; //Stopband frequency\n",
+"dp=0.01; //Passband ripple\n",
+"ds=0.002; //Stopband ripple\n",
+"M=100; //Decimation Factor\n",
+"Fti=Ft; //Input sampling rate\n",
+"//Single stage implementation\n",
+"[N1,R1]=func(Fs,Fp,Ft,Fti,dp,ds,M);\n",
+"\n",
+"//Two stage implementation\n",
+"//Stage 1 F(z) with decimation factor 50\n",
+"Fpf=Fp; //Passband frequency\n",
+"Fsf=190; //Stopband frequency\n",
+"dpf=0.005; //Passband ripple\n",
+"dsf=0.002; //Stopband ripple\n",
+"Mf=50; //Decimation Factor\n",
+"Fti=Ft; //Input sampling rate\n",
+"[N2f,R2f]=func(Fsf,Fpf,Ft,Fti,dpf,dsf,Mf);\n",
+"\n",
+"//Stage 2 G(z) with decimation factor 2\n",
+"Fpg=50*Fp; //Passband frequency\n",
+"Fsg=50*Fs; //Stopband frequency\n",
+"dpg=0.005; //Passband ripple\n",
+"dsg=0.002; //Stopband ripple\n",
+"Mg=2; //Decimation Factor\n",
+"Fti=Ft/50; //Input sampling rate\n",
+"[N2g,R2g]=func(Fsg,Fpg,Ft,Fti,dpg,dsg,Mg);\n",
+"N2=N2f+50*N2g+2; //Total filter length\n",
+"R2=R2f+R2g; //Total Number of Multiplications per second\n",
+"disp(R1,'Number of Multiplications per second =',N1,'FIR filter length =','For Single stage implementation:');\n",
+"disp('For Two stage implementation:');\n",
+"disp(R2f,'Number of Multiplications per second =',N2f,'FIR filter length =','For F(z):');\n",
+"disp(R2g,'Number of Multiplications per second =',N2g,'FIR filter length =','For G(z):');\n",
+"disp(R2,'Total Number of Multiplications per second =',N2,'Overall FIR filter length =');\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.6: Decimator_implementation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 11.6\n",
+"\n",
+"clc;clear;\n",
+"\n",
+"\n",
+"function [N,R]=func(Fs,Fp,Ft,Fti,dp,ds,M)\n",
+" dF=(Fs-Fp)/Ft; //Normalised transition bandwidth\n",
+" N=round((-20*log10(sqroot(dp*ds))-13)/(14.6*dF)); //FIR Filter length\n",
+" R=N*Fti/M; //Number of Multiplications per second\n",
+"endfunction\n",
+"\n",
+"Ft=10000; //Sampling rate of input signal\n",
+"Fp=150; //Passband frequency\n",
+"Fs=180; //Stopband frequency\n",
+"dp=0.002; //Passband ripple\n",
+"ds=0.001; //Stopband ripple\n",
+"M=20; //Decimation Factor\n",
+"Fti=Ft; //Input sampling rate\n",
+"//Single stage implementation\n",
+"[N1,R1]=func(Fs,Fp,Ft,Fti,dp,ds,M);\n",
+"\n",
+"//Two stage implementation\n",
+"//Stage 1 F(z) with decimation factor 50\n",
+"Fpf=Fp; //Passband frequency\n",
+"Fsf=720; //Stopband frequency\n",
+"dpf=0.001; //Passband ripple\n",
+"dsf=0.001; //Stopband ripple\n",
+"Mf=10; //Decimation Factor\n",
+"Fti=Ft; //Input sampling rate\n",
+"[N2f,R2f]=func(Fsf,Fpf,Ft,Fti,dpf,dsf,Mf);\n",
+"\n",
+"//Stage 2 G(z) with decimation factor 2\n",
+"Fpg=10*Fp; //Passband frequency\n",
+"Fsg=10*Fs; //Stopband frequency\n",
+"dpg=0.001; //Passband ripple\n",
+"dsg=0.001; //Stopband ripple\n",
+"Mg=2; //Decimation Factor\n",
+"Fti=Ft/10; //Input sampling rate\n",
+"[N2g,R2g]=func(Fsg,Fpg,Ft,Fti,dpg,dsg,Mg);\n",
+"N2=N2f+10*N2g+2; //Total filter length\n",
+"R2=R2f+R2g; //Total Number of Multiplications per second\n",
+"\n",
+"disp(R1,'Number of Multiplications per second =',N1,'FIR filter length =','For Single stage implementation:');\n",
+"disp('For Two stage implementation:');\n",
+"disp(R2f,'Number of Multiplications per second =',N2f,'FIR filter length =','For F(z):');\n",
+"disp(R2g,'Number of Multiplications per second =',N2g,'FIR filter length =','For G(z):');\n",
+"disp(R2,'Total Number of Multiplications per second =',N2,'Overall FIR filter length =');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/12-Spectral_Estimation.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/12-Spectral_Estimation.ipynb
new file mode 100644
index 0000000..c527bc1
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/12-Spectral_Estimation.ipynb
@@ -0,0 +1,101 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12: Spectral Estimation"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.2: Power_Spectrum.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 12.2\n",
+"clc;clear;close;\n",
+"N=8;n=0:N-1;\n",
+"f1=0.6;f2=0.62;\n",
+"x=cos(2*%pi*f1*n)+cos(2*%pi*f2*n);\n",
+"L1=8;\n",
+"for k=0:L1-1\n",
+" P1(k+1)=1/N*abs(x*(cos(%pi*n*k/L1)-%i*sin(%pi*n*k/L1))')^2\n",
+"end\n",
+"L2=16;\n",
+"for k=0:L2-1\n",
+" P2(k+1)=1/N*abs(x*(cos(%pi*n*k/L2)-%i*sin(%pi*n*k/L2))')^2;\n",
+"end\n",
+"L3=32;\n",
+"for k=0:L3-1\n",
+" P3(k+1)=1/N*abs(x*(cos(%pi*n*k/L3)-%i*sin(%pi*n*k/L3))')^2;\n",
+"end\n",
+"subplot(311);\n",
+"plot2d3(0:L1-1,P1);title('L=8');\n",
+"subplot(312);\n",
+"plot2d3(0:L2-1,P2);title('L=16');\n",
+"subplot(313);\n",
+"plot2d3(0:L3-1,P3);title('L=32');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.4: Frequency_resolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 12.4\n",
+"clc;clear;close;\n",
+"N=1000;\n",
+"Q=10;\n",
+"disp(N,'Length of sample sequence N=',Q,'Quality factor Q=');\n",
+"f_bart=Q/(1.11*N);\n",
+"f_w=Q/(1.39*N);\n",
+"f_bt=Q/(2.34*N);\n",
+"disp(f_bart,'Bartlett Frequency resolution =');\n",
+"disp(f_w,'Welch Frequency resolution =');\n",
+"disp(f_bt,'Blackman Turkey Frequency resolution =');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/2-Fourier_Analysis_of_Preiodic_and_Aperiodic_Continuous_Time_Signals_and_Systems.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/2-Fourier_Analysis_of_Preiodic_and_Aperiodic_Continuous_Time_Signals_and_Systems.ipynb
new file mode 100644
index 0000000..1577953
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/2-Fourier_Analysis_of_Preiodic_and_Aperiodic_Continuous_Time_Signals_and_Systems.ipynb
@@ -0,0 +1,361 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Fourier Analysis of Preiodic and Aperiodic Continuous Time Signals and Systems"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1: Fourier_Series_of_Periodic_Square_Wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.1\n",
+"\n",
+"clc;clear;close;\n",
+"A=1;T=2;\n",
+"w0=2*%pi/T;\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients\n",
+"a0=A/T*(integrate('-1','t',-T/2,-T/4)+integrate('+1','t',-T/4,T/4)+integrate('-1','t',T/4,T/2));\n",
+"for n=1:10;\n",
+"a(1,n)=2*A/T*(integrate('-cos(n*w0*t)','t',-T/2,-T/4)+integrate('+cos(n*w0*t)','t',-T/4,T/4)+integrate('-cos(n*w0*t)','t',T/4,T/2));\n",
+"b(1,n)=2*A/T*(integrate('-sin(n*w0*t)','t',-T/2,-T/4)+integrate('+sin(n*w0*t)','t',-T/4,T/4)+integrate('-sin(n*w0*t)','t',T/4,T/2));\n",
+"end\n",
+"\n",
+"//Displaying fourier coefficients\n",
+"disp(T,'fundamental period T= ',A,'Assumption: Amplitude A= ');\n",
+"disp('Tignometric fourier series co-efficients:');\n",
+"disp(a0,'a0= ');disp(a,'an= ');disp(b,'bn= ');\n",
+"\n",
+"x=[-A*ones(1,25) A*ones(1,50) -A*ones(1,25)] //Function for ploting purpose\n",
+"t=-T/2:0.01*T:T/2-0.01;\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(a);\n",
+"title('Coefficients an');xlabel('n');\n",
+"subplot(313);plot2d3(b);\n",
+"title('Coefficients bn');xlabel('n');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2: Fourier_Series_of_Periodic_Rectangular_Wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.2\n",
+"\n",
+"clc;clear;close;\n",
+"A=1;T=2;\n",
+"w0=2*%pi/T;\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients\n",
+"a0=A/T*integrate('1','t',-T/4,T/4);\n",
+"for n=1:10;\n",
+"a(1,n)=2*A/T*integrate('cos(n*w0*t)','t',-T/4,T/4);\n",
+"b(1,n)=2*A/T*integrate('sin(n*w0*t)','t',-T/4,T/4);\n",
+"end\n",
+"\n",
+"//Displaying fourier coefficients\n",
+"disp(T,'fundamental period T= ',A,'Assumption: Amplitude A= ');\n",
+"disp('Tignometric fourier series co-efficients:');\n",
+"disp(a0,'a0= ');disp(a,'an= ');disp(b,'bn= ');\n",
+"\n",
+"x=[zeros(1,25) A*ones(1,50) zeros(1,25)];\n",
+"t=-T/2:0.01*T:T/2-0.01;\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(a);\n",
+"title('Coefficients an');xlabel('n');\n",
+"subplot(313);plot2d3(b);\n",
+"title('Coefficients bn');xlabel('n');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3: Fourier_Series_of_Periodic_Half_Wave_Rectified_Sine_Wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.3\n",
+"\n",
+"clc;clear;close;\n",
+"A=1;T=2;\n",
+"w0=2*%pi/T;\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients\n",
+"a0=A/T*integrate('sin(w0*t)','t',0,T/2);\n",
+"for n=1:10;\n",
+"a(1,n)=2*A/T*integrate('sin(w0*t)*cos(n*w0*t)','t',0,T/2);\n",
+"b(1,n)=2*A/T*integrate('sin(w0*t)*sin(n*w0*t)','t',0,T/2);\n",
+"end\n",
+"\n",
+"//Displaying fourier coefficients\n",
+"disp(T,'fundamental period T= ',A,'Assumption: Amplitude A= ');\n",
+"disp('Tignometric fourier series co-efficients:');\n",
+"disp(a0,'a0= ');disp(a,'an= ');disp(b,'bn= ');\n",
+"\n",
+"t=0:0.01*T:T/2;\n",
+"x=[A*sin(w0*t) zeros(1,50)];\n",
+"t=0:0.01*T:T;\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(a);\n",
+"title('Coefficients an');xlabel('n');\n",
+"subplot(313);plot2d3(b);\n",
+"title('Coefficients bn');xlabel('n');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4: Fourier_Series_of_Periodic_Triangular_Wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.4\n",
+"\n",
+"clc;clear;close;\n",
+"A=1;T=2;\n",
+"w0=2*%pi/T;\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients\n",
+"a0=4*A/T*(integrate('t-0.5*T','t',-T/2,-T/4)+integrate('t','t',-T/4,T/4)+integrate('-t+0.5*T','t',T/4,T/2));\n",
+"for n=1:10;\n",
+"a(1,n)=2*4*A/T*(integrate('(t-0.5*T)*cos(n*w0*t)','t',-T/2,-T/4)+integrate('t*cos(n*w0*t)','t',-T/4,T/4)+integrate('(-t+0.5*T)*cos(n*w0*t)','t',T/4,T/2));\n",
+"b(1,n)=2*4*A/T*(integrate('(t-0.5*T)*sin(n*w0*t)','t',-T/2,-T/4)+integrate('t*sin(n*w0*t)','t',-T/4,T/4)+integrate('(-t+0.5*T)*sin(n*w0*t)','t',T/4,T/2));\n",
+"end\n",
+"\n",
+"//Displaying fourier coefficients\n",
+"disp(T,'fundamental period T= ',A,'Assumption: Amplitude A= ');\n",
+"disp('Tignometric fourier series co-efficients:');\n",
+"disp(a0,'a0= ');disp(a,'an= ');disp(b,'bn= ');\n",
+"\n",
+"t=-T/2:0.01*T:T/2;\n",
+"x=[-4*A/T*t(1:25)-2*A 4*A/T*t(26:75) -4*A/T*t(76:101)+2*A];\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(a);\n",
+"title('Coefficients an');xlabel('n');\n",
+"subplot(313);plot2d3(b);\n",
+"title('Coefficients bn');xlabel('n');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5: Fourier_Series_of_Periodic_Rectangular_Pulse.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.5\n",
+"\n",
+"clc;clear;close;\n",
+"A=1;T=2;d=0.1;\n",
+"w0=2*%pi/T;\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients\n",
+"a0=A/T*integrate('1','t',-T/4,T/4);\n",
+"for n=1:10;\n",
+"a(1,n)=2*A/T*integrate('cos(n*w0*t)','t',-d/2,d/2);\n",
+"b(1,n)=2*A/T*integrate('sin(n*w0*t)','t',-d/2,d/2);\n",
+"end\n",
+"\n",
+"//Displaying fourier coefficients\n",
+"disp(d,'pulse width d= ',T,'fundamental period T= ',A,'Assumption: Amplitude A= ');\n",
+"disp('Tignometric fourier series co-efficients:');\n",
+"disp(a0,'a0= ');disp(a,'an= ');disp(b,'bn= ');\n",
+"\n",
+"n=round(50*d/T); //Variable used for plotting pulses accurately\n",
+"x=[zeros(1,50-n) A*ones(1,2*n+1) zeros(1,50-n)]\n",
+"t=-T/2:0.01*T:T/2;\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(a);\n",
+"title('Coefficients an');xlabel('n');\n",
+"subplot(313);plot2d3(b);\n",
+"title('Coefficients bn');xlabel('n');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6: Fourier_Series_of_Square_Wave.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.6\n",
+"\n",
+"clc;clear;close;\n",
+"A=1;T=2;\n",
+"w0=2*%pi/T;\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients\n",
+"a0=A/T*(integrate('-1','t',-T/2,0)+integrate('+1','t',0,T/2));\n",
+"for n=1:10\n",
+"a(1,n)=2*A/T*(integrate('-cos(n*w0*t)','t',-T/2,0)+integrate('+cos(n*w0*t)','t',0,T/2));\n",
+"b(1,n)=2*A/T*(integrate('-sin(n*w0*t)','t',-T/2,0)+integrate('+sin(n*w0*t)','t',0,T/2));\n",
+"end\n",
+"a=clean(a);b=clean(b); //Function used to round small entities to zero\n",
+"\n",
+"//Calculation of exponential fourier series co-efficients\n",
+"function y=f(t),y=complex(cos(n*w0*t),-sin(n*w0*t)),endfunction;\n",
+"for n=-10:10\n",
+"c(1,n+11)=A/T*(-1*intc(-T/2,0,f)+intc(0,T/2,f));\n",
+"end\n",
+"c=clean(c); //Function used to round small entities to zero\n",
+"\n",
+"//Calculation of trignometric fourier series co-efficients from exponential fourie series coefficients\n",
+"a01=c(1);\n",
+"a1=2*real(c(12:21));\n",
+"b1=-2*imag(c(12:21));\n",
+"\n",
+"//Displaying fourier coefficients\n",
+"disp(T,'fundamental period T= ',A,'Assumption: Amplitude A= ');\n",
+"disp('Tignometric fourier series co-efficients:');\n",
+"disp(a0,'a0= ');disp(a,'an= ');disp(b,'bn= ');\n",
+"disp('Exponential fourier series co-efficients');\n",
+"disp(c(11),'c0= ');disp(c(12:21),'cn= ');disp(c(10:-1:1),'c-n= ');\n",
+"disp('Trignometric fourier series co-efficients from exponential coefficients:');\n",
+"disp(a01,'a0= ');disp(a1,'an= ');disp(b1,'bn= ');\n",
+"disp('The co-effifcients obtained are same by both methods')\n",
+"\n",
+"x=[-A*ones(1,50) A*ones(1,51)];\n",
+"t=-T/2:0.01*T:T/2;\n",
+"n=-10:10;\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(a);\n",
+"title('Coefficients an');xlabel('n');\n",
+"subplot(313);plot2d3(b);\n",
+"title('Coefficients bn');xlabel('n');\n",
+"figure;\n",
+"subplot(311);plot(t,x);\n",
+"title('x(t)');xlabel('time t');\n",
+"subplot(312);plot2d3(n,abs(c));\n",
+"title('Magnitude of Coefficients |c|');xlabel('n');\n",
+"subplot(313);plot2d3(n,atan(c));\n",
+"title('Phase of Coefficients /_c');xlabel('n');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.8: Complex_fourier_series_representation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 2.8\n",
+"\n",
+"clc;clear;close;\n",
+"t=poly(0,'t');\n",
+"//cn=3/(4+(n*%pi)^2)\n",
+"Pt=0.669; //Total energy\n",
+"Preq=0.999*Pt; //Required energy\n",
+"c0=3/(4+(0*%pi)^2);\n",
+"disp(c0,'c0=');\n",
+"P=(abs(c0))^2;\n",
+"c=[];n=0;\n",
+"while P<Preq\n",
+" n=n+1;\n",
+" c(n)=3/(4+(n*%pi)^2);\n",
+" disp(c(n),'cn=',n,'n=');\n",
+" P=P+2*(abs(c(n)))^2;\n",
+"end\n",
+"disp(Pt,'Total power Pt=');\n",
+"disp(Preq,'99.9% of total power Preqd=');\n",
+"disp(n,'To iclude 99.9% of energy, we need to retain n terms where n=');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/3-Applications_of_Laplace_Transform_to_System_Analysis.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/3-Applications_of_Laplace_Transform_to_System_Analysis.ipynb
new file mode 100644
index 0000000..7b2a735
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/3-Applications_of_Laplace_Transform_to_System_Analysis.ipynb
@@ -0,0 +1,118 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: Applications of Laplace Transform to System Analysis"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.10: Poles_and_Zeros.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 3.10\n",
+"\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"I=3*s/(s+2)/(s+4);\n",
+"disp(I,'Given Transfer Function:');\n",
+"zero=roots(numer(I));\n",
+"pole=roots(denom(I));\n",
+"disp(zero,'Zeros of transfer function: ');\n",
+"disp(pole,'Poles of transfer function: ');\n",
+"plzr(I);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.11: Poles_and_zeros.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 3.11\n",
+"\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"F=4*(s+1)*(s+3)/(s+2)/(s+4);\n",
+"disp(F,'Given Transfer Function:');\n",
+"zero=roots(numer(F));\n",
+"pole=roots(denom(F));\n",
+"disp(zero,'Zeros of transfer function: ');\n",
+"disp(pole,'Poles of transfer function: ');\n",
+"plzr(F);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.12: Poles_and_zeros.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 3.12\n",
+"\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"F=10*s/(s^2+2*s+2);\n",
+"disp(F,'Given Transfer Function:');\n",
+"zero=roots(numer(F));\n",
+"pole=roots(denom(F));\n",
+"disp(zero,'Zeros of transfer function: ');\n",
+"disp(pole,'Poles of transfer function: ');\n",
+"plzr(F);"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/4-Z_Transforms.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/4-Z_Transforms.ipynb
new file mode 100644
index 0000000..84a06bb
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/4-Z_Transforms.ipynb
@@ -0,0 +1,229 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Z Transforms"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.13: Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 4.13\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"x1=[4 -2 1];n1=0:length(x1)-1;\n",
+"X1=x1*(z^-n1)';\n",
+"x2=[1 1 1 1 1];n2=0:length(x2)-1;\n",
+"X2=x2*(z^-n2)';\n",
+"X3=X1*X2;\n",
+"l=coeff(numer(X3));\n",
+"x3=l(:,$:-1:1);\n",
+"disp(X1,'x1(n)={4,-2,1} X1(z)=');\n",
+"disp(X2,'x2(n)={1,1,1,1,1} X2(z)=');\n",
+"disp(X3,'Z transform of convolution of the two signals X3(z)=');\n",
+"disp(x3,'Convolution result of the two signals= ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.14: Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 4.14\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"x1=[2 1 0 0.5];n1=0:length(x1)-1;\n",
+"X1=x1*(z^-n1)';\n",
+"x2=[2 2 1 1];n2=0:length(x2)-1;\n",
+"X2=x2*(z^-n2)';\n",
+"X3=X1*X2;\n",
+"l=coeff(numer(X3));\n",
+"x3=l(:,$:-1:1);\n",
+"disp(X1,'x1(n)={2,1,0,0.5} X1(z)=');\n",
+"disp(X2,'x2(n)={2,2,1,1} X2(z)=');\n",
+"disp(X3,'Z transform of convolution of the two signals X3(z)=');\n",
+"disp(x3,'Convolution result of the two signals= ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.16: Cross_correlatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 4.16\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"x1=[1 2 3 4];n1=0:length(x1)-1;\n",
+"X1=x1*(z^-n1)';\n",
+"x2=[4 3 2 1];n2=0:length(x2)-1;\n",
+"X2=x2*(z^-n2)';\n",
+"X2_=x2*(z^n2)';\n",
+"X3=X1*X2_;\n",
+"l=coeff(numer(X3));\n",
+"x3=l(:,$:-1:1);\n",
+"disp(X1,'x1(n)={4,-2,1} X1(z)=');\n",
+"disp(X2,'x2(n)={4,-2,1} X2(z)=');\n",
+"disp(X3,'Z transform of cross crrelation of the two signals X3(z)=');\n",
+"disp(x3,'Cross correlation result of the two signals= ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.19: System_response.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 4.19\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"h=[1 2 3];n1=0:length(h)-1;\n",
+"H=h*(z^-n1)';\n",
+"y=[1 1 2 -1 3];n2=0:length(y)-1;\n",
+"Y=y*(z^-n2)';\n",
+"X=Y/H;\n",
+"l=coeff(numer(X));\n",
+"x=l(:,$:-1:1);\n",
+"disp(H,'h(n)={1,2,3} H(z)=');\n",
+"disp(Y,'y(n)={1,1,2,-1,3} Y(z)=');\n",
+"disp(X,'Z transform of input sequence X(z)=');\n",
+"disp(x,'Inpput Sequence = ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2: Z_transform.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 4.2\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"x1=[3 1 2 5 7 0 1];n1=-3:3;\n",
+"X1=x1*(z^-n1)';\n",
+"x2=[2 4 5 7 0 1 2];n2=-2:4;\n",
+"X2=x2*(z^-n2)';\n",
+"x3=[1 2 5 4 0 1]; n3=0:5;\n",
+"X3=x3*(z^-n3)';\n",
+"x4=[0 0 1 2 5 4 0 1];n4=0:7;\n",
+"X4=x4*(z^-n4)';\n",
+"X5=z^0;\n",
+"X6=z^-5;\n",
+"X7=z^5;\n",
+"disp(X1,'x1(n)={3,1,2,5,7,0,1} X1(z)=');\n",
+"disp(X2,'x2(n)={2,4,5,7,0,1,2} X2(z)=');\n",
+"disp(X3,'x3(n)={1,2,5,4,0,1} X3(z)=');\n",
+"disp(X4,'x4(n)={0,0,1,2,5,4,0,1} X4(z)=');\n",
+"disp(X5,'x5(n)=delta(n) X5(z)=');\n",
+"disp(X6,'x6(n)=delta(n-5) X6(z)=');\n",
+"disp(X7,'x7(n)=delta(n+5) X7(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4: Z_transform.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 4.4\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"x=[1 3 0 0 6 -1];n=-1:4;\n",
+"X=x*(z^-n)';\n",
+"disp(X,'x(n)={1,3,0,0,6,-1} X(z)=');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/5-Linear_Time_Invariant_Systems.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/5-Linear_Time_Invariant_Systems.ipynb
new file mode 100644
index 0000000..ba1d711
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/5-Linear_Time_Invariant_Systems.ipynb
@@ -0,0 +1,91 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5: Linear Time Invariant Systems"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.20: System_response.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 5.20\n",
+"\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"x=[-1 1 0 -1];n=0:length(x)-1;\n",
+"X=x*(z^-n)';\n",
+"H=0.2-0.5*z^-2+0.4*z^-3\n",
+"Y=H*X;\n",
+"l=coeff(numer(Y));\n",
+"y=l(:,$:-1:1);\n",
+"disp(X,'Input sequence x(n)={-1,1,0,-1} X(z)=');\n",
+"disp(H,'System Transfer Function H(z)=');\n",
+"disp(Y,'Z transform of output response Y(z)=');\n",
+"disp(y,'Digital output sequence y=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.21: Poles_and_zeros.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 5.21\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"H=(1+z^-1)/(1+3/4*z^-1+1/8*z^-2);\n",
+"pole=roots(numer(H));\n",
+"zero=roots(denom(H));\n",
+"disp(H,'System Transfer Function H(z)=');\n",
+"disp(zero,'System zeros are at');\n",
+"disp(pole,'System poles are at ');\n",
+"plzr(H);"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/6-Discrete_and_Fast_Fourier_Transforms.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/6-Discrete_and_Fast_Fourier_Transforms.ipynb
new file mode 100644
index 0000000..ab6ad3d
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/6-Discrete_and_Fast_Fourier_Transforms.ipynb
@@ -0,0 +1,1000 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: Discrete and Fast Fourier Transforms"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.10: DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.10\n",
+"\n",
+"clc;clear;close;\n",
+"x=[1 1 2 2 3 3];\n",
+"//Calculation of DFT\n",
+"X=dft(x,-1);\n",
+"X=clean(X);\n",
+"disp(x,'Given Sequence is x(n): ');\n",
+"disp(X,'DFT of the Sequence is X(k): ');\n",
+"subplot(3,1,1);\n",
+"plot2d3(x);\n",
+"title('Given Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->');\n",
+"subplot(3,1,2);\n",
+"plot2d3(abs(X));\n",
+"title('Magnitude Spectrum |X(k)|');xlabel('k-->');\n",
+"subplot(3,1,3);\n",
+"plot2d3(atan(X));\n",
+"title('Phase Spectrum /_X(k)');xlabel('k-->');\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.11: DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.11\n",
+"\n",
+"clc;clear;close;\n",
+"N=8;A=1/4;\n",
+"n=0:N-1;\n",
+"x=A^n;\n",
+"//Calculation of DFT\n",
+"X=dft(x,-1);\n",
+"X=clean(X);\n",
+"disp(x,'Given Sequence is x(n): ');\n",
+"disp(N,'N=')\n",
+"disp(X,'N-point DFT of the Sequence is X(k): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.12: DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.12\n",
+"\n",
+"clc;clear;close;\n",
+"N=4;\n",
+"n=0:N-1;\n",
+"x=cos(%pi/4*n);\n",
+"//Calculation of DFT\n",
+"X=dft(x,-1);\n",
+"X=clean(X);\n",
+"disp(x,'Given Sequence is x(n): ');\n",
+"disp(X,'DFT of the Sequence is X(k): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.13: Inverse_DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.13\n",
+"clc;clear;close;\n",
+"X=[1 2 3 4];\n",
+"//Calculation of IDFT\n",
+"x=dft(X,1);\n",
+"x=clean(x);\n",
+"disp(X,'DFT of the Sequence is X(k): ');\n",
+"disp(x,'Sequence is x(n): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.14: Inverse_DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.14\n",
+"clc;clear;close;\n",
+"X=[3 2+%i 1 2-%i];\n",
+"//Calculation of IDFT\n",
+"x=dft(X,1);\n",
+"x=clean(x);\n",
+"disp(X,'DFT of the Sequence is X(k): ');\n",
+"disp(x,'Sequence is x(n): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.15: DIT_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.15\n",
+"\n",
+"clc;clear;\n",
+"x=[1 2 3 4 4 3 2 1];\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.16: DIT_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.16\n",
+"\n",
+"clc;clear;\n",
+"x=[0 1 2 3 4 5 6 7];\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.17: DIT_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.17\n",
+"\n",
+"clc;clear;\n",
+"n=0:7;\n",
+"x=2^n;\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.18: DIT_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.18\n",
+"\n",
+"clc;clear;\n",
+"x=[0 1 2 3];\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.19: DIF_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.19\n",
+"\n",
+"clc;clear;\n",
+"x=[1 2 3 4 4 3 2 1];\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1: Linear_and_Circular_convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.1\n",
+"clc;clear;close;\n",
+"x1=[1 1 2 2];\n",
+"x2=[1 2 3 4];\n",
+"ylength=length(x1);\n",
+"//Calculation of linear convolution\n",
+"z=convol(x1,x2);\n",
+"//Calculation of circular convolution\n",
+"for n=1:ylength\n",
+" y(n)=0;\n",
+" for k=1:ylength,\n",
+" l=n-k+1;\n",
+" if l <= 0 then\n",
+" l=l+ylength;\n",
+" end\n",
+" y(n)=y(n)+(x1(k)*x2(l));\n",
+" end\n",
+"end\n",
+"//Calculation of circular convolution using DFT and IDFT\n",
+"X1=dft(x1,-1);\n",
+"X2=dft(x2,-1);\n",
+"Y1=X1.*X2;\n",
+"y1=dft(Y1,1);\n",
+"y1=clean(y1);\n",
+"disp(z,'Linear Convolution sequence is z(n): ');\n",
+"disp(y,'Circular Convolution sequence is y(n): ');\n",
+"disp(y1,'Circular Convolution sequence calculated using DFT-IDFT method is y(n): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.20: DIF_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.20\n",
+"\n",
+"clc;clear;\n",
+"n=0:7;\n",
+"x=2^n;\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.21: DIF_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.21\n",
+"\n",
+"clc;clear;\n",
+"n=0:7;\n",
+"x=n+1;\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.22: DIF_FFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.21\n",
+"\n",
+"clc;clear;\n",
+"n=0:3;\n",
+"x=cos(n*%pi/2);\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.23: IFFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.23\n",
+"\n",
+"clc;clear;\n",
+"X=[6 -2+2*%i -2 -2-2*%i];\n",
+"x=clean(ifft(X));\n",
+"disp(X,'X(k)=');\n",
+"disp(x,'x(n)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.24: IFFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.24\n",
+"\n",
+"clc;clear;\n",
+"X=[20 -5.828-2.414*%i 0 -0.172-0.414*%i 0 -0.172+0.414*%i 0 -5.828+2.414*%i];\n",
+"x=round(clean(ifft(X)));\n",
+"disp(X,'X(k)=');\n",
+"disp(x,'x(n)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.25: IFFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.25\n",
+"\n",
+"clc;clear;\n",
+"X=[255 48.63+166.05*%i -51+102*%i -78.63+46.05*%i -85 -78.63-46.05*%i -51-102*%i 48.63-166.05*%i];\n",
+"x=round(clean(ifft(X)));\n",
+"disp(X,'X(k)=');\n",
+"disp(x,'x(n)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.26: IFFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.26\n",
+"\n",
+"clc;clear;\n",
+"X=[36 -4+9.656*%i -4+4*%i -4+1.656*%i -4 -4-1.656*%i -4-4*%i -4-9.656*%i ];\n",
+"x=round(clean(ifft(X)));\n",
+"disp(X,'X(k)=');\n",
+"disp(x,'x(n)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.27: IFFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.27\n",
+"\n",
+"clc;clear;\n",
+"t=0:0.0025:0.0175;\n",
+"f=50;\n",
+"x=sin(2*%pi*f*t);\n",
+"X=clean(fft(x));\n",
+"disp(x,'x(n)=');\n",
+"disp(X,'X(k)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2: FIR_filter_response.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.2\n",
+"\n",
+"clc;clear;close;\n",
+"x=[1 2];\n",
+"h=[1 2 4];\n",
+"\n",
+"//Calculation of linear convolution\n",
+"y=convol(x,h);\n",
+"disp(x,'Input Sequence is x(n): ');\n",
+"disp(h,'Impulse respnose of FIR filter h(n): ');\n",
+"disp(y,'Output sequence is y(n): ');\n",
+"subplot(3,1,1);\n",
+"plot2d3(x);\n",
+"title('Input Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(h);\n",
+"title('Impulse Response h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(y);\n",
+"title('Output Seqence y[n]=x[n]*h[n] :');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.34: Overlap_Add_Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.34\n",
+"\n",
+"clc;clear;close;\n",
+"h=[2 2 1];\n",
+"x=[3 0 -2 0 2 1 0 -2 -1 0];\n",
+"M=length(h); //length of impulse response\n",
+"L=2^M; //length of FFT/IFFT operation\n",
+"N=L-M+1;\n",
+"xl=length(x);\n",
+"K=ceil(xl/N); //number of iterations\n",
+"h=[h zeros(1,L-M)];\n",
+"x=[x x(1:K*N-xl)];\n",
+"H=fft(h);\n",
+"y=zeros(1,M-1);\n",
+"for k=0:K-1\n",
+" xk=[x(k*N+1:(k+1)*N) zeros(1,M-1)];\n",
+" Xk=fft(xk);\n",
+" Yk=H.*Xk;\n",
+" yk=ifft(Yk);\n",
+" yk=clean(yk);\n",
+" y=[y(1:k*N) y(k*N+1:k*N+M-1)+yk(1:M-1) yk(M:L)];\n",
+" disp(k+1,'Segment =');\n",
+" disp(xk,'xk(n)=');\n",
+" disp(yk,'yk(n)=');\n",
+"end\n",
+"y=y(1:xl+M-1);\n",
+"disp(y,'Output Sequence is y(n): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.35: Overlap_Save_Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.35\n",
+"\n",
+"clc;clear;close;\n",
+"h=[2 2 1];\n",
+"x=[3 0 -2 0 2 1 0 -2 -1 0];\n",
+"M=length(h); //length of impulse response\n",
+"L=2^M; //length of FFT/IFFT operation\n",
+"N=L-M+1;\n",
+"xl=length(x);\n",
+"K=ceil(xl/N); //number of iterations\n",
+"h=[h zeros(1,L-M)];\n",
+"x=[zeros(1,M-1) x x(1:K*N-xl)];\n",
+"H=fft(h);\n",
+"for k=0:K-1\n",
+" xk=x(k*N+1:(k+1)*N+M-1);\n",
+" Xk=fft(xk);\n",
+" Yk=H.*Xk;\n",
+" yk=ifft(Yk);\n",
+" yk=clean(yk);\n",
+" y=[y(1:k*N) yk(M:L)];\n",
+" disp(k+1,'Segment =');\n",
+" disp(xk,'xk(n)=');\n",
+" disp(yk,'yk(n)=');\n",
+"end\n",
+"disp(y,'Output Sequence is y(n): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.36: Cross_Correlatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.36\n",
+"\n",
+"clc;clear;close;\n",
+"x=[1 0 0 1];\n",
+"h=[4 3 2 1];\n",
+"ylength=length(x)+length(h)-1;\n",
+"xlength=length(x);\n",
+"x=[zeros(1,length(h)-1) x zeros(1,length(h)-1)];\n",
+"y=0;\n",
+"//Calculation of cross correlation\n",
+"for n=1:ylength;\n",
+" y(n)=x*[zeros(1,n-1) h zeros(1,ylength-n)]'; //this instruction performs cross correlation of x & h\n",
+"end \n",
+"\n",
+"disp(x,'First Sequence is x(n): ');\n",
+"disp(h,'Second Sequence is h(n): ');\n",
+"disp(y,'Correlation Sequence y[n] is');\n",
+"figure;\n",
+"subplot(3,1,1);\n",
+"plot2d3(x);\n",
+"title('First Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(h);\n",
+"title('Second Seqence h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(y);\n",
+"title('Correlation Seqence y[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.37: Circular_Correlatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.37\n",
+"\n",
+"clc;clear;close;\n",
+"x=[1 0 0 1];\n",
+"h=[4 3 2 1];\n",
+"ylength=length(x);\n",
+"y=0;\n",
+"//Calculation of circular correlation\n",
+"for n=1:ylength,\n",
+" y(n)=0;\n",
+" for k=1:ylength,\n",
+" l=k-n+1;\n",
+" if l <= 0 then\n",
+" l=l+ylength;\n",
+" end\n",
+" y(n)=y(n)+(x(k)*h(l));\n",
+" end\n",
+" y(n)=y(n)/4;\n",
+"end\n",
+"\n",
+"disp(x,'First Sequence is x(n): ');\n",
+"disp(h,'Second Sequence is h(n): ');\n",
+"disp(y,'Correlation Sequence y[n] is');\n",
+"figure;\n",
+"subplot(3,1,1);\n",
+"plot2d3(x);\n",
+"title('First Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(h);\n",
+"title('Second Seqence h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(y);\n",
+"title('Correlation Seqence y[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.3: Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.3\n",
+"\n",
+"clc;clear;close;\n",
+"x=[1 1 1];\n",
+"h=[1 1 1];\n",
+"\n",
+"//Calculation of linear convolution\n",
+"y=convol(x,h);\n",
+"disp(x,'First Sequence is x(n): ');\n",
+"disp(h,'Second Sequence is h(n): ');\n",
+"disp(y,'Output sequence is y(n): ');\n",
+"subplot(3,1,1);\n",
+"plot2d3(x);\n",
+"title('First Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(h);\n",
+"title('Second Seqence h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(y);\n",
+"title('Convolution Seqence y[n]=x[n]*h[n] :');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4: Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.4\n",
+"\n",
+"clc;clear;close;\n",
+"a=0.5;\n",
+"n=1:50;\n",
+"x=ones(1,50);\n",
+"h=a^n;\n",
+"\n",
+"//Calculation of linear convolution\n",
+"for i=1:50\n",
+" y(1,i)=sum(h(1:i));\n",
+"end\n",
+"disp('First Sequence is x(n)=u(n) ');\n",
+"disp(a,'Second Sequence is h(n)=a^n*u(n) where a= ');\n",
+"disp(y,'Output sequence is y(n): ');\n",
+"subplot(3,1,1);\n",
+"plot2d3(x);\n",
+"title('First Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(h);\n",
+"title('Second Seqence h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(y);\n",
+"title('Convolution Seqence y[n]=x[n]*h[n] :');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.5: Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.5\n",
+"clc;clear;close;\n",
+"x=[1 2 3];xmin=0;nx=xmin:length(x)+xmin-1;\n",
+"h=[1 2 -2 -1];hmin=-1;nh=length(h)+hmin-1;\n",
+"\n",
+"//Calculation of linear convolution\n",
+"y=convol(x,h);\n",
+"ymin=xmin+hmin;ny=ymin:length(y)+ymin-1;\n",
+"\n",
+"disp(x,'First Sequence is x(n): ');\n",
+"disp(h,'Second Sequence is h(n): ');\n",
+"disp(y,'Output sequence is y(n): ');\n",
+"subplot(3,1,1);\n",
+"plot2d3(nx,x);\n",
+"title('First Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(nh,h);\n",
+"title('Second Seqence h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(ny,y);\n",
+"title('Convolution Seqence y[n]=x[n]*h[n] :');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.6: Convolution.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.6\n",
+"\n",
+"clc;clear;close;\n",
+"x=[1 1 0 1 1];xmin=-2;nx=xmin:length(x)+xmin-1;\n",
+"h=[1 -2 -3 4];hmin=-3;nh=length(h)+hmin-1;\n",
+"\n",
+"//Calculation of linear convolution\n",
+"y=convol(x,h);\n",
+"ymin=xmin+hmin;ny=ymin:length(y)+ymin-1;\n",
+"\n",
+"disp(x,'First Sequence is x(n): ');\n",
+"disp(h,'Second Sequence is h(n): ');\n",
+"disp(y,'Output sequence is y(n): ');\n",
+"subplot(3,1,1);\n",
+"plot2d3(nx,x);\n",
+"title('First Seqence x[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,2);\n",
+"plot2d3(nh,h);\n",
+"title('Second Seqence h[n]:');ylabel('Amplitude-->');xlabel('n-->')\n",
+"subplot(3,1,3);\n",
+"plot2d3(ny,y);\n",
+"title('Convolution Seqence y[n]=x[n]*h[n] :');ylabel('Amplitude-->');xlabel('n-->')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8: DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.8\n",
+"\n",
+"clc;clear;close;\n",
+"L=3;A=1/4;\n",
+"x=A*ones(1,L);\n",
+"//Calculation of DFT\n",
+"X=dft(x,-1);\n",
+"X=clean(X);\n",
+"disp(x,'Given Sequence is x(n): ');\n",
+"disp(X,'DFT of the Sequence is X(k): ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.9: DFT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 6.9\n",
+"\n",
+"clc;clear;close;\n",
+"L=3;A=1/5;\n",
+"n=-1:1;\n",
+"x=A*ones(1,L);\n",
+"//Calculation of DFT\n",
+"X=dft(x,-1);\n",
+"X=clean(X);\n",
+"disp(x,'Given Sequence is x(n): ');\n",
+"disp(X,'DFT of the Sequence is X(k): ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/7-Finite_Impulse_Response_Filters.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/7-Finite_Impulse_Response_Filters.ipynb
new file mode 100644
index 0000000..22e742e
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/7-Finite_Impulse_Response_Filters.ipynb
@@ -0,0 +1,107 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Finite Impulse Response Filters"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3: Low_pass_filter_using_fourier_series_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 7.3\n",
+"\n",
+"clc;clear;close;\n",
+"fp=2000; //passband frequency\n",
+"F=9600; //sampling frequancy\n",
+"\n",
+"//Calculation of filter co-efficients\n",
+"a0=1/F*integrate('1','t',-fp,fp);\n",
+"for n=1:10;\n",
+"a(1,n)=2/F*integrate('cos(2*%pi*n*f/F)','f',-fp,fp);\n",
+"end\n",
+"h=[a(:,$:-1:1)/2 a0 a/2];\n",
+"\n",
+"//Displaying filter co-efficients\n",
+"disp(F,'Sampling frequency F= ',fp,'Assumption: Passband frequency fp= ');\n",
+"disp('Filter co-efficients:');\n",
+"disp(a0,'h(0)= ');disp(a/2,'h(n)=h(-n)=');\n",
+"\n",
+"n=-10:10;\n",
+"plot2d3(n,h);\n",
+"title('Filter transfer function h(n)');xlabel('n-->');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4: Low_pass_filter_using_Type_1_frequency_sampling_technique.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 7.4\n",
+"\n",
+"clc;clear;close;\n",
+"M=7;w=2*%pi/M;\n",
+"\n",
+"//Calculation of filter co-efficients\n",
+"k=[0 1 6];\n",
+"for n=0:M-1\n",
+" h(n+1)=sum(exp(-%i*3*w*k).*exp(%i*w*k*n))/M;\n",
+"end\n",
+"h=clean(h);\n",
+"\n",
+"//Displaying filter co-efficients\n",
+"disp(M,'Filter Order M= ');\n",
+"disp('Filter co-efficients:');\n",
+"disp(h,'h(n)= ');\n",
+"\n",
+"plot2d3(h);\n",
+"title('Filter transfer function h(n)');xlabel('n-->');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/8-Infinite_Impulse_Response_Filters.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/8-Infinite_Impulse_Response_Filters.ipynb
new file mode 100644
index 0000000..4739be4
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/8-Infinite_Impulse_Response_Filters.ipynb
@@ -0,0 +1,478 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8: Infinite Impulse Response Filters"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.10: IIR_filter_Design_by_Bilinear_Transformation_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.10\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=0.1;\n",
+"Hs=1/(s+1)^2;\n",
+"Hz=ss2tf(cls2dls(tf2ss(Hs),T));\n",
+"disp('Using Bilinear Transformation:');\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.11: Butterworth_Filter_using_Impulse_Invariant_transformation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.11\n",
+"clc;clear;close;\n",
+"rp=0.707 //passband ripple\n",
+"rs=0.2 //stopband ripple\n",
+"wp=%pi/2; //passband frequency\n",
+"ws=3*%pi/4; //stopband frequency\n",
+"T=1;\n",
+"fp=wp/T;\n",
+"fs=ws/T;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"hs=1;\n",
+"//Calculating the order of filter\n",
+"num=log((rs^-2 -1)/(rp^-2 -1));\n",
+"den=2*log(fs/fp);\n",
+"N=ceil(num/den);\n",
+"\n",
+"//Calculation of cut-off frequency\n",
+"fc=fp/(rp^-2 -1)^(0.5/N);\n",
+"\n",
+"//Calculating filter response\n",
+"if modulo(N,2)==1 then\n",
+" b=-2*sin(%pi/(2*N));\n",
+" hs=hs*fc/(s+fc);\n",
+"end\n",
+"for k=1:N/2\n",
+" b=2*sin((2*k-1)*%pi/(2*N));\n",
+" hs=hs*fc^2/(s^2+b*fc*s+fc^2);\n",
+"end\n",
+"hs=clean(hs);\n",
+"sys=syslin('c',hs); \n",
+"hz=horner(ss2tf(dscr(sys,T)),1/z); //converting H(s) to H(z)\n",
+"\n",
+"//Displaying filter response\n",
+"[hzm,fr]=frmag(hz,256);\n",
+"disp(hz,'Filter Transfer function: ');\n",
+"plot(fr,hzm);\n",
+"title('Lowpass Butterworth Filter Response');ylabel('Amplitude-->');xlabel('Normalised frequency f/fs-->');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.12: Butterworth_Filter_using_Bilinear_transformation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.12\n",
+"clc;clear;close;\n",
+"rp=0.9 //passband ripple\n",
+"rs=0.2 //stopband ripple\n",
+"wp=%pi/2; //passband frequency\n",
+"ws=3*%pi/4; //stopband frequency\n",
+"T=1;\n",
+"fp=2/T*tan(wp/2);\n",
+"fs=2/T*tan(ws/2);\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"hs=1;\n",
+"//Calculating the order of filter\n",
+"num=log((rs^-2 -1)/(rp^-2 -1));\n",
+"den=2*log(fs/fp);\n",
+"N=ceil(num/den);\n",
+"\n",
+"//Calculation of cut-off frequency\n",
+"fc=fp/(rp^-2 -1)^(0.5/N);\n",
+"\n",
+"//Calculating filter response\n",
+"if modulo(N,2)==1 then\n",
+" hs=hs*fc/(s+fc);\n",
+"end\n",
+"for k=1:N/2\n",
+" b=2*sin((2*k-1)*%pi/(2*N));\n",
+" hs=hs*fc^2/(s^2+b*fc*s+fc^2);\n",
+"end\n",
+"hs=clean(hs);\n",
+"sys=syslin('c',hs); \n",
+"hz=ss2tf(cls2dls(tf2ss(sys),T)); //converting H(s) to H(z)\n",
+"\n",
+"//Displaying filter response\n",
+"[hzm,fr]=frmag(hz,256);\n",
+"disp(hz,'Filter Transfer function: ');\n",
+"plot(fr,hzm);\n",
+"title('Lowpass Butterworth Filter Response');ylabel('Amplitude-->');xlabel('Normalised frequency f/fs-->');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.14: Filter_transformation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.14\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"fc=1; //Assumed cut off frequency\n",
+"Q=10;f0=2; //Given data\n",
+"Hs=1/(s^2+2*s+1);\n",
+"l=fc*(s^2+f0^2)/(s*f0/Q);\n",
+"Hs1=horner(Hs,l);\n",
+"disp(Hs,'Low pass filter H(s)=');\n",
+"disp(Hs1,'Band pass filterH(s)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.15: Filter_transformation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.15\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"fc=1; //Assumed cut off frequency of low pass filter\n",
+"f0=5; //Assumed cut off frequency of high pass filter\n",
+"Hs=fc/(s+fc);\n",
+"Hs1=horner(Hs,fc*f0/s);\n",
+"disp(Hs,'H(s)=',fc,'Low pass filter with fc=');\n",
+"disp(Hs1,'H(s)=',f0,'High pass filter with fc=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.1: IIR_filter_Design_byBackward_Difference_For_Derivative_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.1\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=1;\n",
+"Hs=1/(s+2);\n",
+"Hz=horner(Hs,(1-1/z)/T);\n",
+"disp('Using Backward difference formula for derivative:')\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2: IIR_filter_Design_byBackward_Difference_For_Derivative_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.2\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=1;\n",
+"Hs=1/(s^2+16);\n",
+"Hz=horner(Hs,(1-1/z)/T);\n",
+"disp('Using Backward difference formula for derivative:')\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3: IIR_filter_Design_byBackward_Difference_For_Derivative_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.3\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=1;\n",
+"Hs=1/((s+0.1)^2+9);\n",
+"Hz=horner(Hs,(1-1/z)/T);\n",
+"disp('Using Backward difference formula for derivative:')\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4: IIR_filter_Design_by_Impulse_Invariant_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.4\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=1;\n",
+"Hs=(s+0.2)/((s+0.2)^2+9);\n",
+"Hz=horner(Hs,(1-1/z)/T);\n",
+"disp('Using Impulse Invariant Technique:')\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.5: IIR_filter_Design_by_Impulse_Invariant_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.5\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=1;\n",
+"Hs=1/(s+1)/(s+2);\n",
+"Hz=horner(Hs,(1-1/z)/T);\n",
+"disp('Using Impulse Invariant Technique:')\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.6: IIR_filter_Design_by_Impulse_Invariant_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.6\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=1;\n",
+"Hs=1/(s+0.5)/(s^2+0.5*s+2);\n",
+"Hz=horner(Hs,(1-1/z)/T);\n",
+"disp('Using Impulse Invariant Technique:')\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7: IIR_filter_Design_by_Bilinear_Transformation_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.7\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=0.276;\n",
+"Hs=(s+0.1)/((s+0.1)^2+9);\n",
+"Hz=ss2tf(cls2dls(tf2ss(Hs),T));\n",
+"disp('Using Bilinear Transformation:');\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8: IIR_filter_Design_by_Bilinear_Transformation_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.8\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=0.1;\n",
+"Hs=2/(s+1)/(s+2);\n",
+"Hz=ss2tf(cls2dls(tf2ss(Hs),T));\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.9: IIR_filter_Design_by_Bilinear_Transformation_method.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 8.9\n",
+"clc;clear;close;\n",
+"s=poly(0,'s');\n",
+"z=poly(0,'z');\n",
+"T=0.1;\n",
+"wr=0.25*%pi; //Given cut off frequency\n",
+"fc=2/T*tan(wr/2);\n",
+"Hs=fc/(s+fc);\n",
+"Hz=ss2tf(cls2dls(tf2ss(Hs),T));\n",
+"disp('Using Bilinear Transformation:');\n",
+"disp(Hs,'H(s)=');\n",
+"disp(Hz,'H(z)=');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Digital_Signal_Processing_by_S_Salivahanan/9-Realisation_of_Digital_Linear_Systems.ipynb b/Digital_Signal_Processing_by_S_Salivahanan/9-Realisation_of_Digital_Linear_Systems.ipynb
new file mode 100644
index 0000000..1368fb5
--- /dev/null
+++ b/Digital_Signal_Processing_by_S_Salivahanan/9-Realisation_of_Digital_Linear_Systems.ipynb
@@ -0,0 +1,116 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9: Realisation of Digital Linear Systems"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.4: Cascade_Realisatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 9.4\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"Hz=2*(z+2)/(z*(z-0.1)*(z+0.5)*(z+0.4));\n",
+"H=dscr(Hz);\n",
+"disp(Hz,'System Function H(z)=');\n",
+"disp(H,'System Function for cascade realisation Hk(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.5_a: Parallel_Realisatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 9.5.a\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"s=poly(0,'s');\n",
+"Hz=3*(2*z^2+5*z+4)/(2*z+1)/(z+2);\n",
+"H=pfss(Hz/z);\n",
+"for k=1:length(H)\n",
+" H(k)=clean(H(k));\n",
+" H1(k)=z*horner(H(k),z);\n",
+"end\n",
+"disp(Hz,'System Function H(z)=');\n",
+"disp(H1,'System Function for parallel realisation Hk(z)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.5_b: Parallel_Realisatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Example 9.5.b\n",
+"clc;clear;close;\n",
+"z=poly(0,'z');\n",
+"s=poly(0,'s');\n",
+"Hz=3*z*(5*z-2)/(z+1/2)/(3*z-1);\n",
+"H=pfss(Hz/z);\n",
+"for k=1:length(H)\n",
+" H(k)=clean(H(k));\n",
+" H1(k)=z*horner(H(k),z);\n",
+"end\n",
+"disp(Hz,'System Function H(z)=');\n",
+"disp(H1,'System Function for parallel realisation Hk(z)=');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}