You are on page 1of 7

PROJECT NAME

IIR Filter Design

Documented by R. Hariprakash

Purpose of the project

To Design an IIR filter technique using CCS & Matlab Software

Concept of the project

To design an IIR filter technique to filter the unwanted frequencies, for specified Filter type.

1. IIR Filter Design In this experiment the IIR filters are implemented by using the Matlab filter coefficients and input frequency. In IIR filter is Infinite no of order and its have four types of filters. We have to ADC & DAC memory address, ADC channel selection, Filter types & operation and DAC Selection. a. ADC & DAC memory address Input signal get from the function generator and its applied to the ADC channel. The ADC read data from the memory address and DAC write the data into following addresses.
Socvalue = 0x60000558 AdcRead = 0x60000554 DacWrite = 0x60000554 b. ADC Channel Selection

The channel selection is done by the following table. Table-1 ADC Channel Select ADC Channels 1 2 3 4 0x00 0x01 0x02 0x03 SocValues

The sampled input signal and output signal stored exact addresses and other datas are stored in SDRAM memory. For example select the first channel means to set SocValue = 0x00. c. Filter Type & Operation In IIR filter perform Low Pass, High Pass, Band Pass, Band Reject operation to the input frequency. We calculated and store the filter coefficients in separate header file. Now get input sample from ADC and multiply the filter coefficient. The multiplied value is stored in variable. And increment the ADC sample value address memory, because the updated value stored in starting location. To use while condition for program is executed in multiple times . The stored variables perform OR operation with set value for DAC channel operation. d. DAC Channel selection The DAC channel selection is done by the follow table, the set value is multiply with output data to select the output channel. Table-2 DAC Channel Select DAC Channels 1 2 3 4 Set Value 0x1000 0x5000 0x9000 0xD000

The given input signal is filtered and views the output in CRO. Change the input frequency and see output variations. But maintain the amplitude (voltage) 5v and below. Amplitude is increase greater than 5 volt the output signal is triggered. 2. Design IIR Filter Using Matlab IIR is a Infinite Impulse Response Filter that means it is in a infinite order. In Matlab to design a filter parameters in FDATOOL window. After opening the fdatool window to select filter response type which type of filter you design (low pass, high pass, Band pass, Band reject). And select a Design method FIR or IIR. In IIR filter type have many technique to design a filter to select any one of the technique. Next select the filter order and set specify order. Enter the order of the filter above 32. Finally set Sampling, pass & stop band frequency (set Sampling frequency twice at the pass band Frequency). Next click design filter button to view your filter model. Then does the following Fileexport to Simulink model. Next change destination option to select NEW option then click Realize the Model. The filter model is created successfully. Then open the Simulink window to copy and paste the following. 1. Memory copy It is used for Read and Write operation in a specific memory address. Here we need three block one for ADC channel select, next is Read the ADC value and another one is Write the output value. a. ADC channel select block i) First click the source button to change the following.
Copy from: input port (before set the constant block)

Data type: uint16

ii) Next click destination button


Copy to: Specified address Specified address source: specify via dialog Address: hex2dec (60000558) Data type: uint16 Sample time: 1/20000 b. ADC Read block

i) First click the source button to change the following.


Copy from: Specified address Specified address source: specify via dialog Address: hex2dec (60000554) Data type: uint16

ii) Next click destination button


Copy to: Output port Data type: uint16 Sample time: 1/20000

c. DAC write block i) First click the source button to change the following.
Copy from: Input port Data type: uint16

ii) Next click destination button


Copy to: Specified address Specified address source: specify via dialog Address: hex2dec (60000554) Data type: uint16 Sample time: 1/20000

d. Data type conversion It is used to convert the unsigned data into signed data because filter block perform operation in signed no only. Double click the block and set output data type in int16 or int32 or single or double. Then set sampling frequency 1/20000. e. Digital Filter Block It is our designed block. Connect data conversion block into digital filter block. Output is connected to data type conversion block. That is convert signed input into unsigned output. f. Bitwise operator block Bitwise operator block is used for select DAC channel selection. Do OR operation with following data (0x1000, 0x5000, 0x9000, 0xD000) to Data conversion output. And high pass, bandpass filter need AND & EX-OR operation to generate the filter output.

Next click simulation button then click configuration parametersEmbedded IDE linkrun timebuild option to set create projectclick ok. Then click increment build option. Next click the Run button. To vary the input frequency and see the output results.

You might also like