This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

DIGITAL SIGNAL PROCESSING LAB MANUAL

IV YEAR I-SEMESTER (ECE)

PRRM ENGINEERING COLLEGE Shabad, R.R.District, AP.

**DIGITAL SIGNAL PROCESSING LAB (IV-I SEM) INDEX
**

1. STUDY OF DSP PROCESSORS ARCHITECTURE- TMS320C54XX/6713 2. A). GENERATION OF UNIT IMPULSE FUNCTION 2. B).GENERATION OF UNIT STEP FUNCTION 2. C).GENERATION OF RAMP FUNCTION 2. D). GENERATION OF EXPONENTIAL FUNCTION 3. SUM OF SINUSOIDAL SIGNALS 4. LINEAR CONVOLUTION (USING BUILT-IN FUNCTION) 5. LINEAR CONVOLUTION (WITH-OUT USING BUILT-IN FUNCTION 6. CIRCULAR CONVOLUTION 7. A) AUTO CORRELATION 7. B) CROSS CORRELATION 8. DISCRETE FOURIER TRANSFORM 9. N-POINT FAST FOURIER TRANSFORM (FFT) ALGORITHM 10. INVERSE DISCRETE FOURIER TRANSFORM 11. FREQUENCY RESPONSE OF ANALOG LP/HP FILTERS 12. POWER DENSITY SPECTRUMOF A SEQUENCE 13. IMPLEMENTATION OF IIR FILTER (LP/HP) ON DSP PROCESSORS 14. A). FIR LOW PASS FILTER USING RECTANGULAR WINDOW 14. B). FIR LOW PASS FILTER USING TRIANGULAR WINDOW 14. C). FIR LOW PASS FILTER USING KAISER WINDOW 14. D). FIR LOW PASS FILTER USING HAMMING WINDOW 14. E). FIR LOW PASS FILTER USING HANNING WINDOW 15. A). IIR LOW PASS FILTER USING BUTTERWORTH APPROXIMATION 15. B). IIR LOW PASS FILTER USING CHEBYSHEY TYPE-1 APPROXIMATION 15. C). IIR-LOW PASS FILTER USING CHEBYSHEY TYPE-2 APPROXIMATION

[USING TMS320C6713 DSP PROCESSOR].

**1. STUDY OF DSP PROCESSORS ARCHITECTURETMS320C54XX/6713
**

Architecture and instruction set of DSP Processor- TMS320C54XX/6713 FEATURES OF HIGHEST- PERFORMANCE FLOATING- POINT DIGITAL SIGNAL PROCESSOR TMS320C54XX/6713 • • • • • • • • • • • • Enhanced Harvard Architecture. VLIW parallel Architecture. Rich Addressing modes. Two general purpose Register files(A0- A15 & B0- B15) 32/64- Bit Data Word. Rich Instruction set. Eight 32- Bit Instructions/Cycle. 32/64- Bit Data Word. 4.4- , 6.7- ns Instruction Cycle Time. 1800 MIPS/1350 MFLOPS Rich Peripheral Set, Optimized for Audio. Highly Optimized C/C++ Complier.

INSTRUCTION SET FEATURES • • • • Single- and Double- Precision Instructions. Byte- Addressable (8-, 16-, 32- Bit Data) 8- Bit Overflow Protection Saturation; Bit- Field Extract, Set, Clear; Bit- Counting; Normalization

Floating.D2 only) Load double word with a 5.bit Constant offset Loads and stores with a 15.bit constant offset(.Point Operations Arithmetic operations conversion operations: DP → SP.L1.S unit (. subtract.M unit (. .bit arithmetic and compare Operations Leftmost 1 or 0 bit counting for 32 bits Normalization count for 32 and 40 bits 32.Point Operations 32/40. .M1. .S2 only) Compare reciprocal and reciprocal square.bit logical operations Branches Constant generation Register transfer to/from the control Register file (. INT→ DP.field Operations 32.S1.L2) Fixed. .bit bit.L unit (.bit constant offset .bit add.bit logical operations. .S2) 32.bit arithmetic operations 32/40Bit shifts and 32.Functional units and operations performed Functional Unit .D2) 32. INT→ SP . linear and Circular address calculation Loads and stores with a 5.D1.root operations Absolute value operations SP to DP Conversion operations.M2) 16 X 16 bit multiply operations 32 X 32 bit multiply Operations Floating – Point multiply operations D unit (.

bit offset) STH (15.bit offset) LDBU (15.M Unit MPY MPYU MPYUS MPYSU MPYH MPYHU ADD ADDK ADD2 AND B disp B IRP+ B NRP+ B reg CLR EXT EXTU MV MVC+ MVK MVKH MVKLH NEG NOT OR .bit offset) LDHU (15.bit offset) LDW (15.bit offset) SUB SUBAB SUBAH SUBAW ZERO CMPGTU MPYHUS CMPLT MPYHSU CMPLTU MPYHL LMBD MV NEG NORM NOT OR SADD SAT SSUB SUB SUBU SUBC XOR ZERO MPYHLU MPYHULS MPYHSLU MPYLH MPYLHU MPYLUHS MPYLSHU SMPY SMPYHL SMPYLH SMPYH .D Unit STB (15.bit offset) MV STB STH STW .C67x instruction set: .S Unit SET SHL SHR SHRU SSHL SUB SUBU SUB2 XOR ZERO ADD ADDAB ADDAH ADDAW LDB LDBU LDH LDHU LDW LDB (15.bit offset) STW (15.bit offset) LDH (15.L Unit ABS ADD ADDU AND CMPEQ CMPGT .

End if block. It is used to generate system response providing fundamental information about the system characteristics. Enter the range of n= -10 to 10. End else block. GENERATION OF UNIT IMPULSE FUNCTION AIM: To generate a unit impulse function using MATLAB. Initialize the iteration count variable to 1 and increment it by 1 for every iteration until it reaches total number of samples.2-A. THEORY: The unit impulse function is defined as 1. 21. n = 0 δ(n) = 0. then assign o to f(a).e.. Plot the graph n Vs f(a). 4. 5. n ≠ 0 The unit impulse function is very useful in continuous system analysis. Specify x label as time and y label as amplitude. 2. 6. Else assign 0 to f(a). i. ALGORITHM: 1. 7. . 3. 8. If a=11.

.->'). end end stem(n. else f(a)=0.PROGRAM CODE: clc. n=-10:10. ylabel ('Amplitude.->'). clear all. for a=1:21 if a==11 f(a)=1. title ('Unit impulse sequence').. close all. . xlabel ('time.f).

.RESULT: Hence the MATLAB program for generation of unit impulse signal was written and verified the graph.

Initialize the iteration count variable to 1 and increment it by 1 for every iteration until it reaches total number of samples. 21.e. End else block. it is represented as 1. Plot the graph n Vs f (a). i. Else assign o to f(a). .. Mathematically. Specify Xlabel as time and y label as amplitude. THEORY: The integral of the impulse function is called as the unit step function which has unit amplitude at n > = 0 and 0 elsewhere.GENERATION OF UNIT STEP FUNCTION AIM: To generate a unit step function using MATLAB. End if block. 3. 5. 6. 4. 8. n >= 0 u(n) = 0. Enter the range of n= . n < 0 ALGORITHM: 1. 7. 2. then assign 1 to f(a).2-B.10 to 10. If a ≥ 11.

PROGRAM CODE: clc. n= -10:10.f). else f(a)=0. title(‘unit step sequence’). . Ylabel(‘Amplitude ----->’). clear all. close all . for a=1:21 if a >= 11 f(a) = 1. end end stem(n. xlabel(‘time ----->’).

.RESULT: Hence the MATLAB program for generation of unit step signal was written and verified the graph.

5. .GENERATION OF RAMP FUNCTION AIM: To generate a Ramp function using MATLAB. Enter the range of n= . Else assign o to f(a). A ramp signal starts at n=0.. THEORY: The integral of unit step function is called as the unit ramp function. 21. If a ≥ 11.e. 7. i. In discrete time domin the unit ramp signal is defined as nt. Specify Xlabel as time and y label as amplitude. 3. then assign “a-11” to f(a). 8. End if block. n < 0 ALGORITHM: 1. Initialize the iteration count variable to 1 and increment it by 1 for every iteration until it reaches total number of samples. 2. n ≥ 0 r(n) = 0. 6. 4. and increases linearly with n. End else block.2-C.10 to 10. Plot the graph n Vs f (a).

else f(a)= 0. Ylabel('Amplitude ----->'). Title('unit ramp sequence').PROGRAM CODE: n= -10:10. for a=1:21 if a >= 11 f(a) = a-11.f) . Xlabel('time ----->'). . end end stem(n.

RESULT: Hence the MATLAB program for the generation of ramp signal was written and verified the graph. .

then assign “α^ (a-11)” to f(a).10 to 10. n<0 Where α is constant. Plot the graph n Vs f(a). 3. i. . 4. If a > = 11. Initialize the iteration count variable to 1 and increment it by 1 for every iteration until it reaches total number of samples.D.2. 7. 9. . 6. ALGORITHM: 1. End else block. n≥0 g(n) = 0. 21. Ask the user to enter the value of α. 2. Enter the range n = . AIM: To generate an exponential function using MATLAB. GENERATION OF EXPONENTIAL FUNCTION. it gives increasing exponential signal.e. and if it is negative value. then it produces a decreasing exponential signal. End if block. 5. Else assign 0 to f(a). THEORY: It is mathematically written as αn. if α is positive real number. Specify x label as time and y label as amplitude. 8.

.y). y= exp (a*t). % Negative value for decreasing Exponential. n = input (‘enter the length of the exponential sequence :’). % positive Value for increasing exponential.clear all. stem (t . close all . Xlabel(‘Time ----->’). t = 0 : n. title(‘exponential sequence’). Ylabel(‘Amplitude ----->). a= input (‘enter the “a” value :’).PROGRAM CODE: clc.

enter the "n" value: 20 enter the "a" value: 0.RESULT: Hence the MATLAB for generation of exponential signal was written and verified the graph. .25 % a is Negative Value.25 % a is Positive Value. enter the "n" value: 20 enter the "a" value: -0.

. y2. SUM OF SINUSOIDAL SIGNALS AIM: To find sum of two sinusoidal signals using MATLAB. Plot the graph t Vs x.. Take other variables y1. are added the resultant signal will no longer be a sinusoidal signal. Observe the differences among all the variables.).).5. 4. ALGORITHM: Enter the range t=0 to 2*pi with an interval of 0. 7. 5. Rather it would be formed in the shape of a random signal. 3. y3 and so on in such a way that each of them are sum of different sinusoidal signals. When two sinusoidal signals of different characteristics (like amplitudes. Specify x label as time and y label as amplitude for each plot. Plot the graphs for each of the variables (t Vs y1. t Vs y2 etc…. THEORY: A sine function is a continuous periodic signal which oscillates between +1 and -1. . 6. 2. 1. Take the function Sin(t) and assign this to variable x. frequencies etc.3...

clear all. xlabel(‘n------>). ylabel(‘amplitude’).2.2. ylabel(‘amplitude’).PROGRAM CODE: clc. t=0:. title(‘sin wave with harmonic’). xlabel(‘n----->’). plot(y1). subplot(4. title(‘sin wave’). y2=sin(t)+5*sin(2*t)+10*sin(3*t). subplot(4.5). stem(y1). x=sin(t).close all.1). subplot(4. title(‘sin wave’). subplot(4. plot(x).2. ylabel(‘amplitude’).2). xlabel(‘n----->’). subplot(4.2. ylabel(‘amplitude’). stem(x). xlabel(‘n----->’).2.3).4). y1=sin(t)+5*sin(2*t). title(‘sin wave with harmonic’). .5:2*pi.

subplot(4. xlabel(‘n----->’). ylabel(‘amplitude’). subplot(4.2. xlabel(‘n----->’).stem(y2). plot(y3). ylabel(‘amplitude’). . stem(y3). y3=sin(t)+5*sin(2*t)+10*sin(3*t)+15*sin(4*t). title(‘ sin wave with three harmonics’).6). ylabel(‘amplitude’).7).2. title(‘ sin wave with three harmonics’).2. xlabel(‘n----->’). ylabel(‘amplitude’). title(‘sin wave with two harmonics’). subplot(4. title(‘sin wave with two harmonics’).8). xlabel(‘n----->’). plot(y2).

.RESULT: Hence the MATLAB program for sum of sinusoidal signals was written and verified the graph.

title(‘input sequence’). Store this sequence in variable x. etc. xlabel(‘Time----->’). 3. display the resultant sequence in the command window using “disp” function. close all. . finding the response of a system for an anonymous input. PROGRAM CODE: clc.1). subplot(3. 2. Plot all the three waveforms using subplot(). ∞ y(n) = ∑ x(k)h(n-k) k= -∞ ALGORITHM: 1.4. Ask the user to enter the input sequence.1. roughly that convolving two sequences is the same as multiplying their Fourier Transforms. Applications of convolutions include Linear filtering of an image. h(n) is given by. Use the inbuilt function conv() to find the convolution of the given sequences. 4. Ask the user to enter the impulse response. ylabel(‘Amplitude------>’). LINEAR CONVOLUTION (USING BUILT-IN FUNCTION) AIM: To find the linear convolution of given sequences using MATLAB THEORY: The convolution theorem says. x=input (‘enter the input sequence:’). stem(x). clear all. Linear convolution of two sequences x(n).1.2). 5. subplot(3. y= input (‘enter the impulse response:’). Store the sequence in variable h. Also.

3).1. title(‘output sequence’). xlabel(‘Time----->’). subplot(3. . y=conv(x. ylabel(‘Amplitude----->’). title(‘input sequence’). ylabel(‘Amplitude------>’).stem(h). n=length(x)+lenth(h)-1.y). stem(m.h) m=0: n-1. xlabel(‘Time------>’).

RESULT: Hence the MATLAB program for Linear Convolution was written and obtained the convolved sequence. Enter the input sequence: [1 2 3 4] Enter the impulse response: [2 1 2 1] y= 2 5 10 16 12 11 4 .

% length of output sequence %-----------------------------Appending Zeros--------------------------------- . where M.1). clear all. stem(x). LINEAR CONVOLUTION (With-out using built-in function) To find the linear convolution of given sequences using MATLAB. subplot(3. PROGRAM CODE: clc. 6. ALGORITHM: 1.1. title('impulse response'). 2. subplot(3.2). Plot all the three sequences using subplot. 3. h=input('Enter the impulse response:'). xlabel('Time--->'). Find the lengths of the given sequence (using “length ( )” command) and calculate the length of resultant sequence. Implement the formula for convolution using for loops and obtain the convolved sequence.1.AIM: 5.1.) 4. ylabel('Amplitude--->'). x=input('Enter the input sequence:'). (M+N-. N are the lengths of resultant sequence respectively. n=length(x)+length(h)-1. title('input sequence'). stem(h). Also display the convolved sequence in the command window using disp() function. Ask the user to enter the input sequence. ylabel('Amplitude--->'). Store this sequence in variable x. Ask the user to enter the impulse response. xlabel('Time--->'). 5. Y. Store this sequence in variable h. close all.

k=k-1. title('Output sequence'). y(i)=0.3).zeros(1..n-length(x))].zeros(1. h=[h.x=[x. xlabel('Time--->'). for j=1:i y(i)=y(i)+x(k)*h(j).y).1. end end %---------------------------------------------------------------------------------disp('Convolution output is. m=0:n-1. ylabel('Amplitude--->').n-length(h))]. %----------------Loop for calculation of convolution-------------------------for i=1:n k=i. disp(y). . subplot(3..'). stem(m.

2 5 10 16 12 11 4 . Enter the input sequence:[1 2 3 4] Enter the impulse response:[2 1 2 1] Convolution output is..RESULTS: Hence the MATLAB program for linear convolution was written and obtained the convolved sequence..

3.N). CIRCULAR CONVOLUTION AIM: To find the circular convolution of given sequence using MATLAB. y.) 4. but with a subtle difference.6. . Store this sequence in variable h. Store this sequence in variable x. 6. THEORY: Circular convolution is analogous to the linear convolution. Plot all the three sequences using subplot. Implement the formula for circular convolution using for loops and obtain the convolved sequence. N are the lengths of given sequences respectively. Find the lengths of the given sequence (using “length ( )” command) and calculate the lengths of the resultant sequence (Max (M. Mathematically. circular convolution is defined as y(n) = And generally it is represented as N It can also be computed by forming of the product of their N-point DFTs and the applying an N-point IDFT. Ask the user to enter the impulse response. ALGORITHM: 1. Where as in circular convolution the resultant sequence would have Max(M. 2. 5. where M. Also display the convolved sequences in the command window using disp() function.N) samples in it. It is achieved by circular time shifting and circular time reversal. Linear convolution produces a sequence of length (M+N-1) with two sequences of lengths M. N respectively. Ask the user to enter the input sequence.

n2). x=input('Enter the input sequence:'). title('Output sequence(Circular convolution)'). clear all. close all. if(j<=0) j=j+n3.Loop for circular convolution---------------------for(n=1:n3). j=n-i+1. ylabel('Amplitude--->'). title('input sequence:'). subplot(3. end end %---------------------------------------------------------------------------------------disp('circ convolution of given sequences is. n4=n1-n2.1). xlabel('Time--->'). xlabel('Time--->').PROGRAM CODE: clc. stem(h). ylabel('Amplitude--->').zeros(1. xlabel('n--->').n4)]. y(n)=0. n3=max(n1. stem(y).. n1=length(x). end y(n)=y(n)+x(i)*h(j).2). else x=[x. ylabel('Amplitude--->'). subplot(3.3). end %---------------------------------..zeros(1. . subplot(3. disp(y). for(i=1:n3). title('impulse response'). h=input('Enter the impulse response:').1.1. stem(x).').-n4)].1. %-----------------------------------------------------------------------------------------% Appending zeros if lengths of the sequences are not equal if(n4>0) h=[h. n2=length(h).

. Enter the input sequence: [2 1 2 1] Enter the impulse response: [1 2 3 4] circ convolution of given sequences is. 14 16 14 16 .Result: Hence the MATLAB program for circular convolution was written and obtained the convolved sequence..

PROGRAM CODE: clc. clear all. Similarly in RADAR and SONAR applications. If one of these sequences is transmitted. For example in digital communications.. Find the auto correlation using the inbuilt function xcorr( ).7(a): AUTO CORRELATION AIM: To find the Auto Correlation of given sequence using MATLAB THEORY: There are applications where it is necessary to compare one reference signal with one or more signals to determine the similarity between the pair and to determine additional information based on the similarity. disp(‘Auto correlation of the sequence is…’). 3. a set of data symbols are represented by a set of unique discrete time sequences.x). ylabel(‘Amplitude . the receiver has to determine which particular sequence has been received by comparing the received signal with every member of possible of sequences from the set. Display the output on command window. The auto correlation sequence of X(n) is given by Note: (n)=Ex the energy of the signal x(n).>’). Ask the user to enter the input sequence. one can determine the location of the target.>’). title(‘Auto correlation’). close all. x = input(‘enter the sexuence’). . stem(y).. ALGORITHM: 1. disp(y). xlabel(‘samples . y = xcorr( x. 2. the received signal reflected from the target is the delayed version of the transmitted signal and by measuring the delay.

0000 11.0000 20.0000 20. 4.0000 30..0000 .0000 4. enter the sequence:[1 2 3 4] Auto correlation of the sequence is.RESUTL: Hence the MATLAB program for auto correlation function was written and the result is obtained..0000 11.

1. n2 = length (h).n2). h= input(‘enter the 2nd sequence’). Ask the user to enter the first sequence.7(b). ylabel(‘amplitude-->’). subplot(3. ylabel(‘amplitude-->’). title(‘2nd ssequence’).h). The cross correlation of two sequence of X(n). m=0:n1-1. 3.1.x). n1= length (x).2). ±3. If one of these sequences is transmitted. the receiver has to determine which particular sequence has been received by comparing the received signal with every member of possible of sequences from the set. ±2. m=0:n2-1. xlabel(‘time-->’). Find the auto correlation using the inbuilt function xcorr( ). CROSS CORRELATION AIM: To find the Auto correlation of given sequence using MATLAB. ±1. a set of data symbols are represented by a set of unique discrete time sequences. x= input(‘enter the 1st sequence’). stem(m.. n = max(n1. Similarly in RADAR and SONAR applications. the received signal reflected from the target is the delayed version of the transmitted signal and by measuring the delay. one can determine the location of the target. subplot(3. stem(m. 2.1). Display the output on command window. For example in digital communications. title(‘1st sequence’). xlabel(‘time-->’). close all.…. Ask the user to enter the second sequence. Y(n) is given by rxy(l)= ALGORITHM: l=0. PROGRAM CODE: clc. THEORY: There are applications where it is necessary to compare one reference signal with one or more signals to determine the similarity between the pair and to determine additional information based on the similarity. clear all. 4.1. .

1.3). title(‘output sequence’).’). . stem(m. subplot(3. xlabel(‘time-->’). %disp(fliplr(y)). ylabel(‘amplitude-->’).h).y). disp(y). disp(‘cross correlation of given sequence is ….y=xcorr(x. m= -(n-1):(n-1).

Output: Hence the MATLAB program for cross correlation function was written and obtained the result.. enter the 1st sequence:[2 1 2 1] enter the 2nd sequence:[1 2 3 4] cross correlation of given sequence is. 8.0000 14.. 10.0000 1.0000.0000 4.0000 .0000 15.0000 8.

If(N<L) error(‘N must be >L’). Ask the user to enter the number of samples in DFT. (number of samples in DFT must be greater than or equal to number of samples in the given sequence). PROGRAM CODE: clc. Ask the user to enter the sequence for which DFT is to be computed... Display the result in the command window. 4.. fft(). clear all.N). 3. disp(Xk). stem(m. xn=input(‘Enter the sequence for which DFT is to be computed:’). N=input(‘Enter the number of samples in the DFT.8. ALGORITHM: 1. . disp(‘DFT of the given sequence is.’). There is a fast algorithm for computing the DFT known as the fast Fourier transform (FFT).There are two principal reasons for using this form: The input and output of the DFT are both discrete which makes it convenient for computer manipulations. m=0:N-1. end Xk=fft(xn. of samples in DFT Working with the Fourier transform on a computer usually involves a form of the transform known as the discrete Fourier transform (DFT). Compute the DFT using built-in function..Xk). L= length(xn). 2. DISCRETE FOURIER TRANSFORM AIM: To find the DFT of given sequence using MATLAB THEORY: DFT of a finite sequence x(n) is defined as X(k)= Where U= N=No.’). close all.

1675i... . 3.. .2082-4.2082-3.2082+3.1675i. -10. 24. 3.2082+4.8900i..8900i. Enter the sequence for which DFT is to be computed: [2 5 8 9] Enter the number of samples in the DFT: 5 DFT of the given sequence is.10.0000.RESULT: Hence the MATLAB program for DFT was written and obtained the result.

Note that 1. it goes round and round the circle). 2. N-POINT FAST FOURIER TRANSFORM (FFT) ALGORITHM [USING TMS320C6713 DSP PROCESSOR]. The vectors are equally spaced around the circle.g. there is a factor called the Twiddle Factor = where N= number of samples. Circle e. 3. . THEORY: The DFT Equation X(k)=1/N where TWIDDLE FACTOR: In the definition of the DFT. It is periodic (i. That the vectors are symmetric. = [TWIDDLE FACTOR] If we take an 8-bit sample sequence we can represent the twiddle factor as a vector in the unit.9. AIM: To find the DFT of a sequence using FFT algorithm.e.

FAST FOURIER TRANSFORM: 2-Point 4-Point 2-Point 8-Point 2-Point 4-Point 2-Point ALGORITHM: 1. 5. . of points and frequencies. of points for FFT. Take sampled data and apply FFT algorithm. Generate a sine wave of frequency ‘f’(eg:10Hz with a sampling rate = no. Use graph option to view the input and the output. 4. 2.) 3. Select the no. Repeat step-1 to 4 for different no.

i=1. i++) { index= 0. i=i*2.PROGRAM CODE: #define PTS 64 typedef struct {float real. lower_leg. extern COMPLEX w[PTS]. j++) { for(upper_leg= j. int upper_leg. input: int leg_diff. int num_steges=0. imag. output: int i. step= (PTS*2)/N. for(j=0.j. step. # of points //#of points for FFT .h // for N-point FFT //temporary storage variables //loop counter variables // index of upper/lower butterfly leg // difference between upper/ lower leg //number of FFT stages (iterations) // index/step through twiddle constant // log (base2) of N-points= # of stages //twiddle constants stored in w //input sample array. for (i=0. leg_diff= N/2. void FFT (COMPLEX *Y. int N) { COMPLEX temp1. temp2. do { num_stages+ =1.} COMPLEX . int index. upper_leg<N.k. } while(i!=N). j<leg_diff. i<num_stages. upper_leg +=(2*leg_diff)) { // difference between & lower legs // step between values in twiddle.

real.imag= (Y[upper_leg]).imag*(w[index]).real= (Y[j]).real-temp2.imag.real.real. temp2. for(i=1. step*=2.imag+(Y[lower_leg]).real.imag= temp1.real= (Y[upper_leg]).real= temp2. while (k<=j) { j= j-k.real. (Y[upper_leg]). } j=0.lower_leg= upper_leg+leg_diff. } leg_diff= leg_diff/2.real*(w[index]). temp2.imag-temp2.real.imag. (Y[lower_leg]). temp1. (Y[upper_leg]).real*(w[index]).imag= (Y[upper_leg]). // bit reversal for re-sequencing data . i<(N-1).real+(Y[lower_leg]).real= (Y[upper_leg]).real= temp1.imag.imag= temp2.imag*(w[index]). if (i<j) { temp1. k=k/2.imag.(Y[lower_leg]). } index+= step.imag-(Y[lower_leg]). temp1. (Y[lower_leg]). i++) { k= N/2. } j= j+k.

temp1.lib”.c” and “FFT. (Y[j]). make sure the DSP kit is turned on. (Y[j]).imag.real=(Y[i]). } } Return. (Y[i]).real.cmd”. Run the program and observe output using graph utility.imag=(Y[i]).imag=(Y[i]).real=temp1. Add the source files “FFT256. Start a new project using ‘project-new’ pull down menu. save it in a separate directory(c:\ti\myprojects) with name “FFT.imag. (Y[j]). Compile the program using the ‘project-compile’ pull down menu or by clicking the short cut icon on the left side of program window. Add the linker to command file “hello.pjt”. Load the program in program memory of DSP chip using the ‘File-load program’ pull down menu. Add the rts file “rts6700.C” in the project using ‘project →add files to project’ pull down menu.imag. } PROCEDURE: • • • • • • • • Open code composer studio. .real.imag= (Y[j]).

.RESULT: Hence the MATLAB program for DFT was written and the result is obtained.

INVERSE DISCRETE FOURIER TRANSFORM AIM: To find the IDFT of given sequence using MATLAB. Working with the Fourier transform on a computer usually involve a form of the transform know as the discrete Fourier transform (DFT). xn= input ('Enter the sequence for which DFT is to be computed: ') . Display the result in the command window. There are two principle reasons for using this form. L= length (xn). 2.10. N).(Number of samples in sequence) . if(N<L) error ('N must be > L'). Ask the user to enter the no. ALGORITHM: Ask the user to enter the sequence for which IDFT is to be computed. ifft(). N= input ('Enter the number of samples in the DFT: ').. PROGRAM CODE: clc.'). Compute the IDFT using built-in function. . The input and output of the DFT are both discrete. There is a fast algorithm for computing the DFT know as the fast Fourier transforms (FFT). X(k)=1/N where = N= no. 1. end XK= fft (xn. 3. of samples in DFT. which makes it convenient for computer manipulations. of samples in DFT. THEORY: IDFT of a finite sequence X(n) is defined as. disp ('DFT of xn is. clear all. close all. disp (XK)..

disp (xn1). Xlabel ('Samples --->'). m=0:N-1.. Ylabel ('Amplitude --->'). Subplot (3. 1. must be same as original sequence)'). 1. subplot (3. disp ('IDFT of XK is. xn). 2). . '). Xlabel ('Samples --->'). Xlabel ('Samples --->').. XK). title ('IDFT of XK (xn1. Ylabel ('Amplitude --->'). Ylabel ('Amplitude --->'). 3). 1). Stem (m.xn1= ifft (XK). subplot (3. title ('original sequence (xn)'). xn1). stem (m. title('DFT of original sequence (XK)'). 1. stem (m.

.0000.. IDFT of XK is. 10.0000i.0000 . Enter the sequence for which DFT is to be computed: [1 2 3 4 ] Enter the number of samples in the DFT: 4 DFT of xn is.0000. -2.0000 + 2. -2.2.0000i. -2... 1 2 3 4 .RESULT: Hence the MATLAB program for IDFT was written and obtained the result.

THEORY: A filter may be defined as a device used to select a set of desired frequencies and reject all other frequencies. 5. digital filters can be classified into two types 1. Draw the response curve . 2. based on the signals they accept. Use the built in functions to calculate the frequency response of the IIR filter. Get the ripples from the user. 3. 1. Get the sampling frequency and order of the filter from the user. FIR Filters 2. Get the cut off frequency from the user. FREQUENCY RESPONSE OF ANALOG LP/HP FILTERS AIM: To find the frequency response of analog LP/HP filters using butter worth approximation. 2. which is given by Y(n)= - y(n-k)+ (n-k) (b) Transfer function. Digital filters Analog filters Again. 4. a filter may be characterized by its (a) Linear difference equation. which is given by ALGORITHM: 1. Filters can be classified into two types.11. IIR Filter In general.

01:pi. [b. subplot(2. ylabel('phase in radians --->'). gain=20*log10(abs(h)).rs. rs=input('enter stop band ripple in db : ').'s').a]=butter(N. w2=2*ws/fs. fs=input('enter the sampling frequence : ').gain).PROGRAM CODE: clc. title('phase res lpf').p.k]=butter(N. plot(omega/pi.p. xlabel('normalized frequency ---->'). rp=input('enter pass band ripple in db : '). ws= input ('enter stop band cutoff frequency : '). W=0:0. [h.2).Wn. title('mag res of lpf'). w1=2*wp/fs. an=angle(h). . wp=input ('enter pass band cutoff frequency : '). %[z. [N.Wn).rp.k).a]=zp2tf(z.W). xlabel('normalized frequency --->').1). %[b. subplot(2.'s').an).Wn]=buttord(w1.a.1. plot(omega/pi. ylabel('gain in db --->').1.omega]=freqs(b. w2.

Hence the MATLAB program for IIR-Filter was written and obtained the .RESULT: result.

Generate a sine wave of frequency ‘f’. 3. apply FFT algorithm. 4. Select no. TO COMPUTE PSD: The value of the auto-correlation function at zero-time equals the total power in the signal. Compute the auto correlation of sine wave. Power spectral Density is a Fourier transform of the auto correlation. of points & frequency. (Another estimation method called “period gram” uses sampled FFT to compute the PSD. Take output of auto correlation.12. THEORY: The total or the average power in a signal is often not of as great an interest. To compute PSD we compute the auto-correlation of the signal and then take its FFT. of Points of FFT(eg. We often want to see is how the input power has been redistributed by the channel and in this frequencybased redistribution of power is where most of the interesting information lies. The PSD is an even function of frequency or in other words. POWER DENSITY SPECTRUMOF A SEQUENCE AIM: To find the PSD of sequence. 5. S(w) =FT(R( ))= R( ) = ALGORITHM: 1.64)) using math library function. (S(w)) = dw . (eg:10 Hz with sampling rate=No. We are most often interested in the PSD or the power spectrum. of points for FFT (eg: 64). The totalarea under the power spectrum or PSD is equal to the total avg. power of the signal. Repeat the step-1 to 5 for different no. The auto-correlation function and PSD are a Fourier transform pair. 6.). Use graph option to view the PSD. 2.

x[PTS]. //FFT prototype //as Input and output buffer //intermeadiate buffer //general purpose index variable //number of new samples in io buffer //set to 1 by ISR when iobuffer full . void FFT(COMPLEX *Y. int n). imag.h> #define PTS 128 #define Pi=3.c * DESCRIPTION * Program to compute Non real time PSD * using the TM320C6711 DSK. short flag = 0. short buffercount = 0.14159265358979 //# of points for FFT typedef struct {float real. * x1--> use in graph window to view PSD.c /********************************************************************/ * FILENAME * Non_real_time_PSD. float x1[PTS]. float iobuffer[PTS].} COMPLEX. short i. /*==========================================================*/ #include<math.PROGRAM CODE: PSD. ********************************************************************/ *DESCRIPTION *Number of points for FFT (PTS) *x---> sine wave co-efficients * iobuffer-->out put of auto-correlation.

k++) { sum=sum+(x[k]*x[n+k]). samples[i]. } /***********************Auto correlation of X(n)=R(t)*********************/ for(n=0.k.imag =-sin(2*Pi*i/(PTS*2.n<PTS.real=0.0)). //Auto correlation R(t) //Signal x(Fs)=sin(2*pi*f**i/fs).k<PTS-n. main () { Float j.0 .i++) { w[i].l.imag=0.0)).i<PTS. COMPLEX w[PTS].i++) { x[i]=sin(2*Pi*5*i/PTS).float y[128].j=0.0. For(i=0. for(k=0. int n.real =cos(2*Pi*i/(PTS*2.sum=0.a. . } /*Re component of twiddle constants*/ /*Im component of twiddle constants*/ //set up twiddle constants in w //twiddle constants stored in w //primary working buffer /**************************Input Signal X(n)****************************/ For(i=0. w[i].i<PTS. COMPLEX samples[PTS]. samples[i].n++) { sum=0.0.

PTS).i<PTS. //imagcompenents = 0 //call functionFFT. } } FFT. FFT(sample. int N). temp2.j.c //swap buffers /***************************** PSD ********************************/ for(i=0.image*samples[i]. imag. extern COMPLEX w[PTS].i<PTS.c: #defined PTS128 //# of points for FFT // end of main //compute the magnitude typedef struct{float real.real*samples[i]. void FFT(COMPLEX*Y. lower_leg.} iobuffer[n]=sum.0.imag =0. } /************************* FFT of R(t) *******************************/ for (i=0. int leg_diff.i++) { samples[i]. int upper_leg.i++) samples[i]. { COMPLEX temp1.real+samples[i].} COMPLEX.k. //temporary storage variables //loop conter variables //index of upper/lower butterfly leg //difference between upper/lower leg //twiddle constant stored in w //input sample array.#of points .i++0) { x1[i]=sqrt(samples[i].i<PTS. //buffer with new data } for (i=0. int i.real=iobuffer[i].image).

do { num_stages +=1. i =1. for(i=0.imag*(w[index]).real + (Y[lower_leg]). temp1.image. int index.imag=temp2. leg_diff=N/2.real=(Y[upper_leg]).real*(w([index]).real (Y[upper_leg]).real.imag + (Y[lower_leg]).imag=temp1. step. temp2. } while (i!=N).real=temp1.real=(Y[upper_leg]).image.real.i++) { index=0. (Y[lower_leg]).temp2.real*(w([index]). upper_leg<N.imag=(Y[upper_leg]).imag=(Y[upper_leg]).j++) { //number of FFT stages(iterations) //index/step through twiddele constant //log(based2)of points=# of stages //difference between upper & lower legs //step between values in twiddle. temp1.i<num_stages.imag*(w[index]).imag + (Y[lower_leg]). i=i*2. for(j=0.real.imag.imag + temp2.(Y[lower_leg]).real=temp2. step=(PTS*2)/N. (Y[upper_leg]).j<leg_diff. . (Y[lower_leg]).real .h//512 //for N-point FFT for(upper_leg=j.int num_stages=0. upper_leg+=(2*leg_diff)) { lower_leg=upper_leg+leg_diff.. temp2.imag.real .

(Y[j].image.real.image=temp. if (i<j) { temp1. } leg_diff=leg_diff/2. } } return. } j=0.real. for(i=0. k=k/2} j=j+k. while(k<=j) { j=j-k.real=(Y[i].real=temp. (Y[i].real=(Y[j].image. } //bit reversal for resequencing data . (Y[i].i<(N-1). (Y[j].image=(Y[i].} index +=step.image=(Y[j].real.i++) { k=N/2. step*=2.image. temp1.

PROCEDURE: Open code composer studio.lib”.c” and “FFT.c” in the project using ‘project add files to project’ pull down menu. Start a new project using ‘project-new’ pull down menu. Compile the program using the ‘project-compile’ pull down menu or by clicking the shortcut icon on the left side of program window. Add the rts file “rts6700. Add the linker command file “hello. Load the program in program memory of DSP chip using the ‘file-load Program’pull down menu. Run the program and observe output using graph utility. save it in a separate rectory (c:\ti\my project) with name “PSD. make sure the DSP kit is turned on.pjt”. . Add the source files “PSD.cmd”.

.RESULT: Hence the C program for PSD was written and obtained the result.

Since codec is stereo. Initialize the MCBSP. Initialize the discrete time system. specify the initial conditions. Store sampled data at a memory location. Representing a system in terms of constant coefficient linear difference equation is its time domain characterization. take average of input data read from left and right channel. then its out put must produced for infinite duration of time.13. In the filter design process. Output the value to codec (left channel & right channel) and view the output at oscilloscope. Implementation of IIR Filter (LP/HP) on DSP Processors AIM: To design and implement a Digital IIR Filter and observe its frequency response. In the design of simple frequency –selective filter we would take help of some basic implementation methods for realizations of LTI systems described by linear constant coefficient difference equation. Generally zero initial conditions are assumed. THEORY: In the design of frequency. the DSP board and the on board codec. ALGORITHM: 1. selective filters. 2. BACKGROUND CONCEPT: An Infinite impulse response (IIR) filter possesses an output response to an impulse which is of an infinite duration. The impulse response is “infinite” since there is feedback in the filter that is if you put in an impulse. Perform filter operation using above said difference equation and store filter output at a memory location 5. Take sampled data from codec while input is fed to DSP kit from the signal generator. we determine the coefficients of a causal IIR filter that closely approximates the desired frequency response specifications. that is. IMPLEMENTATION OF DISCRETE –TIME SYSTEMS: Discrete time Linear Time – Invariant (LTI) systems can be described completely by constant coefficient linear difference equations. 4. Go to step 3. the desired filter characteristics are specified in the frequency domain in terms of the desired magnitude and phase response of the filter. . 6. 3.

312. -7215. /* 5 DSK6713 – AIC23 – DIGPATH Digital audio path control */ \ 0X0000. -23140.PROGRAM CODE: # include “filtercfg.h” # include “dsk6713. 9268. \0X00d8. /* 8 DSK6713 – AIC23 – SAMPLERATE Sample rate control */ \ 0X0001. 1455.AIC23 – RIGHT INVOL Right line input channel Volume*/ /* 2 DSK 6713 – AIC23 – LEFT HPVOL Left channel head phone volume */ /* 3 DSK 6713 – AIC23 – RIGHT HPVOL Right channel head phone volume*/ /*HP2500*/ /*cp800*/ /*LP2500*/ /*HP 4000*/ /*HP 7000*/ \0X00d11. 32767. -7395. /* 4 DSK6713 – AIC23 – ANAPATH Analog audio path control */ \ 0X0000. initializes BSL and generates tone*/ void main ( ) { . 5039. \0X0017. -27943.-18324.AIC23 – LEFT INVOL Left line input channel volume*/ /* 1 DSK 6713 . /* 6 DSK6713 – AIC23 – POWERDOWN Power down control */ \ 0X0043. 24367 //1455.h” # include “dsk6713-aic23. \0X00d8.-9268. 2767. 21735 //9268. 32767. /* 7 DSK6713 – AIC23 – DIGIF Digital audio interface format */ \ 0X0081. /* 9 DSK6713 – AIC23 – DIGACT Digital interface activation */ \ } /* main ( ) . 1455. 18367 //7215. 6171 } /*codec configuration settings*/ DSK6713 AIC23_config config = { \ 0X0017. 7215.-12730. 312.h” const signed int filter_coeff[ ]= { // (12730. /* 0 DSK6713 . 32767. 21137 //312. 32767. 12730.Main code routine.

0}. 0. 0. /* copy input to temp */ . l –output)). must be called first */ DSK6713 – intit ( ). /*send a sample to the right channel */ While (! DSK6713-AIC23-write (hcodec. /* stat the codec */ hCodec = DSK6713 – AIC23 –Open codec (0. l_output. int l_input. While (1) { /* Read a sample to the left channel */ While (! DSK6713-AIc23-read (hcodec. &r-input)). 0). /*send a sample to the left channel */ While (! DSK6713-AIc23-write (hcodec. 0. } signed int IIR_ FILTER (const_signed int *h. 0. /* Initialize the board support library. 0. 3).X(n-2) must be static*/ static signed int Y [6] = {0. /*Y(n). /*Read a sample to the right channel*/ While (! DSK 6713-AIc23-read (hcodec. l-input). temp = (short int) x1. r_output=l-output. /* X(n). l_output=IIR-FILTER (&filter-coeff. 0. } /* close the codec */ DSK6713_AIC23_close codec (hcodec). r-output)). signed int x1) { static signed int X [6] = {0. DSK6713 – AIC23 – set Freq (hcodec.X(n-1).DSK6713_AIC23_CodecHandle hCodec.Y(n-1). 0. r_output. 0. & l -input). & config). r_input.Y(n-2) must be static*/ int temp = 0.

temp = ((int) h [0]*X[0]).X[0] = (signed int) temp. temp _ = ((int) h [4]*Y[1]). /*shuffle values along one place for next time*/ Y[2] =Y[1]. temp + = ((int) h [1]*X[1]). { temp =-32767. } . temp + = ((int) h [2]*X[2]). X[2] = X[1]. { temp =32767. temp _ = ((int) h [4]*Y[1]). temp _ =((int) h [5]*Y[2]). /*copy input to X [stages][0]*/ /* Bo *X(n) */ /*B1/2*X(n-1)*/ /*B1/2*X(n-1)*/ /*B2*X(n-2)*/ /*A1/2*Y(n-1)*/ /*A1/2*Y(n-1)*/ /*A2*Y(n-2)*/ /*Divide temp by coefficients [A0]*/ } temp>>=15. if (temp<32767). /*Y(n-2)=Y(n-1)*/ /*Y(n-1)=Y(n)*/ /*X(n-2)=X(n-1)*/ /*X(n-1)=X(n) */ /*temp is used as input next time through*/ return (temp<<2). X[1] = X[0]. } else if (temp<-32767). Y[1] = Y[0]. temp + = ((int) h [1]*X[1]). } Y[0] = temp.

RESULT: Hence the C program for IIR filter was written and obtained the result. .

2)~=0) N=N+1. wr=boxcar(N+1). Get the sampling frequency and order of the filter from the user. Use the built in functions to calculate the frequency response of the FIR filter. clear all.14. fs = input ('Enter the sampling frequency:'). b=fir1(N. N = input ('Enter the order of the filter:'). . THEORY: The rectangular window function is given by 1. wn. FIR LOW PASS FILTER USING RECTANGULAR WINDOW AIM: To find response of an FIR LPF using rectangular window. 1. end wn=2*fc/fs. if (rem(N. PROGRTAM CODE: clc. otherwise ALGORITHM: Get the cut off frequency from the user. (A). close all.1). 2. wr). 3. fc = input ('Enter the cut off frequency:'). freqz(b. for │n│ ≤ (M-1) / 2 WR (N) = 0. Draw the response curve.

Enter the cut off frequency: 300 Enter the sampling frequency: 1000 Enter the order of the filter: 20. .RESULT: Hence the MATLAB program for the FIR Low pass filter using rectangular window is written and obtained the response curves.

**14.(B). FIR LOW PASS FILTER USING TRIANGULAR WINDOW
**

AIM: To find response of an FIR LPF using Triangular window. THEORY: The triangular window function is given by

(1-│ n │), for │n│ ≤ (M-1)/2 WT (n) = 0, otherwise ALGORITHM: Get the cut off frequency from the user. 1. Get the sampling frequency and order of the filter from the user. 2. Use the built in functions to calculate the frequency response of the FIR filter. 3. Draw the response curve. PROGRAM CODE: clc, clear all; close all; fc= input ('Enter the cut off frequency:'); fs= input ('Enter the sampling frequency:'); N= input ('Enter the order of the filter:'); if(rem (N, 2)~=0) N=N+1; end wn= 2*fc/fs; wr= triang(N+1); b= fir1(N, wn, wr); freqz(b,1);

RESULT: Hence the MATLAB program for the FIR Low Pass Filter triangular window is written and obtained the response curves. Enter the cut off frequency: 300 Enter the sampling frequency: 1000 Enter the order of the filter: 20

14. (C). FIR LOW PASS FILTER USING KAISER WINDOW AIM: To find response of an FIR LPF using Kaiser window. THEORY: The Kaiser Window function is given by I0(α(√(1-((2n/M)-1)2)), Wn = 0 Where: I0 is the Zeroth order modified Bessel function of the first kind. a is an arbitrary real number that determines the shape of the window. M is an integer, and the length of the sequence is N=M+1. When N is an odd number, the peak value of the window is WM/2=1, and When N is even, the peak values are WN/2-1= WN/2<1. ALGORITHM: Get the cut off frequency from the user. 1. Get the sampling frequency and order of the filter from the user. 2. Use the built in functions to calculate the frequency response of the FIR filter. 3. Draw the response curve. otherwise. 0≤n≤M

wr= kaiser (N+1. . close all. clear all. wn. B=fir1(N. end wn=2*fc/fs. fs= input ('Enter the sampling frequency :').2)~=0) N=N+1. freqz(B. B). if (rem(N. B= 15. fc= input ('Enter the cut off frequency:'). N= input ('Enter the order of the filter :').PROGRAM CODE: clc. wr).1).

RESULT: Hence the MATLAB program for the FIR Low Pass Filter using Kaiser Window is written and obtained the response curves. Output: Enter the cut off frequency: 300 Enter the sampling frequency: 1000 Enter the order of the filter: 20 .

FIR LOW PASS FILTER USING HAMMING WINDOW AIM: To find response of an FIR LPF using Hamming Window. THEORY: The Hamming Window function is given by W(n) = 0. Get the sampling frequency and order of the filter from the user. wr= Hamming (N+1). fs= input ('Enter the sampling frequency: '). wn. Draw the response curve.14. wr). PROGRAM CODE: clc. 1). b= fir1(N. ALGORITHM: Get the cut off frequency from the user. 1.53836-0. if(rem(N. 3. Use the built in function to calculate the frequency response of the FIR filter. . close all. end wn= 2*fc/fs. clear all. fc= input ('Enter the cut off frequency: ').46164 cos(2πn/(N-1)). 2. freqz(b. N= input ('Enter the order of the filter: ').2)~=0) N=N+1. (D).

Output: Enter the cut off frequency: 300 Enter the sampling frequency: 1000 Enter the order of the filter: 20 .RESULT: Hence the MATLAB Program for the FIR Low Pass Filter Using Hamming Window is written and obtained the response curves.

(E). . freqz(b. 1).5(1. fc= input ('Enter the cut off frequency: '). Get the sampling frequency and order of the filter from the user. fs= input ('Enter the sampling frequency: '). Use the built in functions to calculate the frequency response of the FIR Filter. wr= Hanning(N+1).cos(2πn/N-1)) ALGORITHM: Get the cut off frequency from the user. Draw the response curve. end wn= 2*fc/fs. close all. 1.14. FIR LOW PASS FILTER USING HANNING WINDOW AIM: To find response of an FIR-LPF using hanning window. 2. N= input ('Enter the order of the filter: '). THEORY: The Hanning window function is given by W(n) = 0. wn. if(rem (N. clear all. 3. 2)~=0) N=N+1. wr). PROGRAM CODE: clc. b= fir1(N.

Output: Enter the cut off frequency: 300 Enter the sampling frequency: 1000 Enter the order of the filter: 20 .RESULT: Hence the MATLAB program for the FIR Low Pass Filter using Hanning Window is written and obtained the response curves.

Get the cut off frequency from the user. Draw the response curve. rs= input ('Enter the stop band ripple: '). close all. rp= input ('Enter the pass band ripple: '). [b. ws.15. rs). . f= input ('Enter the sampling frequency: ').LPF using Butterworth Approximation.a]= butter(n.wn]=buttord (wp. 3. IIR LOW PASS FILTER USING BUTTERWORTH APPROXIMATION AIM: To find response of the IIR. Get the sampling frequency and order of the filter from the user. [n. fp= input ('Enter the pass band edge frequency: '). ws=2*fs/f. Use the built in function to calculate the frequency response of the IIR filter. freqz(b. ALGORITHM: 1. 2. 4. PROGRAM CODE: clc. wn).a). fs= input ('Enter the stop band edge frequency: '). (A). rp. clear all. wp=2*fp/f.

Output: Enter the pass band edge frequency 200 Enter the stop band edge frequency 500 Enter the sampling frequency 1200 Enter the pass band ripple 10 Enter the stop band ripple 100 .RESULT: Hence the MAYLAB program for the IIR Low Pass Filter using Butterworth approximation is written and obtained the response curves.

rp.wn). [n. wp= 2*fp/f. Get the cut off frequency from the user.rp. freqz(b. fs= input ('Enter the stop band edge frequency: '). 2. (B). fp= input ('Enter the pass band edge frequency: '). 3. 4. [b. .rs). Get the sampling frequency and order of the filter from the user. Draw the response curve. ws= 2*fs/f.a).15. rs= input ('Enter the stop band ripple: '). f= input ('Enter the sampling frequency: ').wn]=cheb1ord(wp. clear all. rp= input ('Enter the pass band ripple: ').a]=cheby1(n. IIR LOW PASS FILTER USING CHEBYSHEY TYPE-1 APPROXIMATION AIM: To find response of an IIR LPF using Chebyshev type-1. PROGRAM CODE: clc. ALGORITHM: 1. Use the built in function to calculate the frequency response of the IIR filter. close all.ws.

Enter the pass band edge frequency 200 Enter the stop band edge frequency 500 Enter the sampling frequency 1200 Enter the pass band ripple 10 Enter the stop band ripple 100 .RESULT: Hence the MATLAB program for the IIR Low Pass Filter using Chebyshev type-1 approximation is written and obtained the response curves.

3. 2. wp= 2*fp/f.wn). fp= input ('Enter the pass band edge frequency: ').a).rs).15. IIR-LOW PASS FILTER USING CHEBYSHEY TYPE-2 APPROXIMATION AIM: To find response of an IIR LPF using Chebyshev type-1. rp= input ('Enter the pass band ripple: '). wn]=cheb2ord(wp. rs= input ('Enter the stop band ripple: '). clear all. ALGORITHM: 1.ws. [b. (C). close all. 4. fs= input ('Enter the stop band edge frequency: '). Use the built in function to calculate the frequency response of the IIR filter. PROGRAM CODE: clc. .rp.rs. freqz(b. f= input ('Enter the sampling frequency: '). [n. Get the sampling frequency and order of the filter from the user. Draw the response curve. ws= 2*fs/f. Get the cut off frequency from the user. a]=cheby2(n.

Output: Enter the pass band edge frequency 200 Enter the stop band edge frequency 500 Enter the sampling frequency 1200 Enter the pass band ripple 10 Enter the stop band ripple 100 .RESULT: Hence the MATLAB program for the IIR Low Pass Filter using Chebyshev type1 approximation is written and obtained the response curves.

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd