Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Advanced Digital Systems

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

COVENTRY UNIVERSITY

FACULTY OF ENGINEERING & COMPUTING BACHELOR OF ENGINEERING (HONS) IN ELECTRONICS ENGINEERING A310SE Advanced Digital Systems

Coursework
STUDENT NAME : M. Faazil Fairooz STUDENT ID NUMBER : 4701970 SUPERVISOR : Prof. Rohan Munasingha

A310SE Advance Digital System | Faazil fairooz

Table of Contents

Abstract.................................................................................................................................................. 2 Literature Review ................................................................................................................................. 3 Design Stages for IIR Filters................................................................................................................. 4 Specification of Filter Requirement ................................................................................................ 5 Calculation of Filter Coefficient ...................................................................................................... 5 Representation Of A Filter By Suitable Structure (Realization) ...................................................... 6 Analysis of the effect of finite word length on filter performance................................................. 8 Implementation of filter in hardware or on software .................................................................... 9 Application of Digital Filters..............................................................................................................10 Fundamental .................................................................................................................................10 Application: - Defense and Navigation .........................................................................................10 Functionality .................................................................................................................................11 Design Criteria .................................................................................................................................... 14 Design Calculations for IIR Filter .......................................................................................................15 Method Two..................................................................................................................................15 Method two ..................................................................................................................................22 Software Implementation................................................................................................................... 28 Matlab Program for Calculations of Filter Coefficient and Plot Frequency Response Spectrum.....29 Method one ..................................................................................................................................29 Method Two..................................................................................................................................33 CCS Program to Implement the Digital Filter on Chip.....................................................................35 Conclusion ........................................................................................................................................... 47 Methodologies ..............................................................................................................................47 Solution Implementation ..............................................................................................................47 Results achieved............................................................................................................................47 Reference ............................................................................................................................................. 48

A310SE Advance Digital System | Faazil fairooz

Abstract

Background The world of communications has been mostly trusting on analogue filters in the past however technology has evolved from slow and inefficient analogue filter to more complex high efficient digital filter designs. Here in this coursework we will study the basic of IIR in both the design and implementation stages. There are significant development methods that are used here we would use a Texas instruments DSP for the purpose of simulation. Results Both simulated and analytical results are shown for the Filter designs in the below chapters

A310SE Advance Digital System | Faazil fairooz

Literature Review

A310SE Advance Digital System | Faazil fairooz

Design Stages for IIR Filters

Designing of a digital filters involve 5 complex stages in each stage we will see how digital filters a built up 1. Specification of Filter Requirement 2. Calculation of Filter Coefficient 3. Representation Of A Filter By Suitable Structure (Realization) Direct Form Cascade Form Parallel Form 4. Analysis of the effect of finite word length on filter performance Errors Degradation 5. Implementation of filter in hardware or on software

Start

Specification of Filter Requirement Calculation of Filter Coefficient Representation Of A Filter By Suitable Structure (Realization)
Restructure Recalculate Re specify

Redesign

Analysis of the effect of finite word length on filter performance Implementation of filter in hardware or on software

Stop

A310SE Advance Digital System | Faazil fairooz

Specification of Filter Requirement

The first step inside planning digital filter systems is to search for the spec. The actual spec is made in line with the specialized specifications in the filter plus the possibility of hardware along with software implementation. Digital filter systems are generally sorts of devices that allow through signals with some frequency while attenuating other frequency. The frequency ranges in which signals pass through are named filter pass-band, and frequency ranges in which signals are rejected are named stop-band. In practical filters, signals attenuate in the pass-band as well as in the stop-band. The most important matter is the characteristics of our design we must critically see what type of response that we are looking into is it amplitude or frequency design, this decision will have a great impact on the speed of operation and the accuracy of the system Secondly we must see how it is possible to implement the system, select a language for our design, as a industrial standard high level language is used for static type operations and for real time systems low level or assembly type languages are used it is not a must but this will mainly enhance development time, processing time etc.

Calculation of Filter Coefficient

Filter coefficient means a set of constants, also called tap weights, accustomed to multiply having delayed signal sample values in a a digital filter construction. A digital filter is usually an physical exercise within figuring out the filter coefficients that may produce the required filter frequency response. A great FIR filter, the filter coefficients are generally, by means of meaning, the impulse response in the filter. This is a very important decision were as this is very crucial requirement the filter specification. The valves of coefficient are different for different filter design like FIR filters there h(k) values to be calculated as to the IIR filter a k and bk are to be found to satisfy the filter

A310SE Advance Digital System | Faazil fairooz The methods of calculating coefficient are different from one to another they are as follows IIR Filter Impulse variant Bilinear transformation Pole-zero placement

FIR Filter Window Frequency sampling Optimal

Representation Of A Filter By Suitable Structure (Realization)


A Flow or block diagrams are usually used to depict filters structures.

Realization involves converting a given transfer function, H(z), into a suitable filter structure.

The basic elements of realization structures are multipliers, adder and delay elements. There are many structure that are involved in the design process Multiplier: Adder/ Accumulator:

Delay of 1 unit of time:

Realization structures for IIR is given bellow

Direct form
H(z) = 1+
6

A310SE Advance Digital System | Faazil fairooz

y(n) =

( )

( )

Cascade Form

In cascade realization the transfer function is factored in N/2 second-order factors


/

( )=

+ 1+ = ( ) ( )

+ +

It is also ( )= + +

( )= 1+

A310SE Advance Digital System | Faazil fairooz

Parallel Form

In parallel form, an Nth-order transfer function H(z) can be expanded using partial fraction. Each second-order section can be realized using the building blocks.
/

( )=

( )

Analysis of the effect of finite word length on filter performance


performance of the filter and could lead to instability

The coefficients, of an IIR Filter are of infinite or very high accuracy which is typically six to seven decimal places. Therefore these systems are prone to errors; these errors degrade the

Errors

The main errors in digital IIR filters are as follows: (PTO)


8

A310SE Advance Digital System | Faazil fairooz ADC quantization noise: Results from representing the samples of the input data, x(n), by only a small number of bits; Coefficient quantization errors Caused by representing the IIR filter coefficients by a finite number of bits;

Overflow errors Result from the additions or accumulation of partial results in a limited register length; Product round off errors, Caused when the output, y(n), and results of internal arithmetic operations are rounded (or truncated) to the permissible word length. Degradation The extent of filter degradation depends on A. The word length and the type of arithmetic used to perform the filtering operation, B. The method used to quantize the filter coefficients and variables, and C. The filter structure.

Implementation of filter in hardware or on software

In the IIR filter, the output, y(n), is computed for each input sample, x(n).Assuming cascade realization using the second-order direct form, the key filtering equation is y(n) = ( ) ( )

This equation clearly shows that to implement the filter we need the following components: I. II. III. IV. Memory (for example ROM) for storing filter coefficients; Memory (for example RAM) for storing the present and past inputs and outputs {x(n), x(n 1), } and {y(n), y(n 1), } Hardware or software multiplier(s); Adder or arithmetic logic unit.

In modern real-time DSP, the filtering operations are efficiently performed with a DSP processor. These processors have all the basic blocks on-board, including in-built hardware multiplier(s).

A310SE Advance Digital System | Faazil fairooz

Application of Digital Filters


1. Fundamental 2. Application:- defense and navigation 3. Functionality

Fundamental

Basically in the modern world everything works on or with a digital signal processor, most commonly known as DSP. Therefore it is hard to imagine specifically or brief on the application of DSP but we will see how DSP occupy todays modern world. Firstly digital filters have replaced old analogue filters because of the affordability, great flexibility, high performance and environmental stability; these specs are the most benefits of digital filters. Digital Filters are basic simple discreet- time, discreet amplitude convolves

Application: - Defense and Navigation


Multipath error correction using Digital filters

Here we will see how the defense field has been enhanced by the extensive use digital filter.

In the modern world of navigation GPS is a lifesaver and most critical application in the fields of defense. These systems are mostly used in Marine navigation, Critical Air Systems and in the areas of missile guidance. Therefore these systems have to reduce their error rate or have a error free guidance system to the utmost. These systems are predominantly affected by the error known as Multipath. This has adversely affected this industry sometime in the past. Error adversely affects the accuracy of the carrier signal changing the object or users position Multipath error means that same wave that is transmitted has been received at the antenna, due to multiple reflections from various objects like structures, mountains, ponds etc. Multipath signals that are transmitted arrive at the host with a phase delay relative to the original signal that is to be received. Because the wave travels the extra path length, then this signal combines with the original wave to create a new distorted wave that has a wrong GPS Coordinates

10

A310SE Advance Digital System | Faazil fairooz

Functionality

Digital filters are employed for the purpose of error correction. A FIR digital filter is built for this error correction. Versatile digital filter calculations are put together to remove and reduce both frequency selected and on envelope modulated multipath signal error. Digital filler is used here because of its robustness and ripple free response. The digital filter works by taking relevant values like the code and carrier data, and then this data is inputted as values for the calculation of multipath time series signals.

The amplitude spectra of the received wave are directly inputted to the system, and then the system begins to compute the cutoff frequencies for the digital filters. There are four digital filters that are built into the cct to eliminate the errors that are occurred due to multipath. The filter cutoff frequencies are updated and changed real time or as a static base to suite the situation. This is only possible only in digital filters if analogue filters were employed a
11

A310SE Advance Digital System | Faazil fairooz physical hardware change like changing of capacitor and resistor is a must if to vary the cutoff frequency This method is not only used by GPS stations but also in all modern day radar to eliminate a common problem known as GHOST. This is another type of multipath error common to radar antennas.

Multipath Error in Radar Console

The effective methodology of mitigating multipath is to estimate and calculated the amount of error that occurs in the multipath frequency band in the spectrum. Therefore it is possible that the filters are built to calculate and estimate the possible error contribution in each frequency band. Based on this the digital filter is built. The purpose of the four filters are that are incorporated are mentioned bellow Buterworth filter This filter is an all pole filter it provides the utmost maximum flat response in the pass band region

12

A310SE Advance Digital System | Faazil fairooz chebyshev filter type 1 This filter has very steep roll-off and more pass band ripple, this is employed in this cct because of its unique frequency selection and it is possible to minimize the error between the original transmitted wave and the actual wave is received chebyshev filter type 2 This filter is employed of its characteristics of having more steeper roll off at the stop band region Elliptic filter It is employed because of its quality with equalized ripple action in both the pass band stop band region

13

A310SE Advance Digital System | Faazil fairooz

Design Criteria

14

A310SE Advance Digital System | Faazil fairooz

Design Calculations for IIR Filter Method Two


Step 1: Filter Specification Filter Mode: Low Pass Digital filter type: IIR Filter

Required specifications

Sampling frequency Passband Transition width Pass band ripple Stopband attenuation Step 2: Filter Coefficient calculations Filter order: 4th Filter type: Elliptical

15 Khz 0-3 Khz 450 Hz 0.5 dB 45 db

Coefficient calculations are as follows


AK 1 2 3 4 5 1.000000E+00 -1.325163E+00 1.480202E+00 -7.841098E-01 2.339270E-01 BK 5.846399E-02 1.359507E-01 1.820297E-01 1.359506E-01 5.846398E-02

Poles and zeros calculation Poles Real 0.247967 0.414664 Real 0.337859 0.824828 Imaginary 0.836885 0.367559 Imaginary 0.941197 0.565983 Z-1 -0.495935 -0.829328 Z-1 0.675718 1.649656 Coefficient Z-2 0.761864 0.307046 Coefficient Z-2 1.000000 1.00000
15

Zeros

A310SE Advance Digital System | Faazil fairooz Transfer function Could be built from the above data

Step 3: Representation of a filter by suitable structure (realization)

( )=

0.058 463 99 + 0.135 950 7 + 0.182 097 9 + 0.135 950 6 + 0.058 463 98 1 1.325 263 + 1.480 202 0.784 109 8 + 0.233 927

As the equation and the system is built by applying the direct form which will sometimes adversely affect the stabilization of the filter. These problem arise due to the finite word length those like coefficient quantization errors. Due to this reason we will break the system to smaller parts and connect them in the cascaded form. Here we will breakdown into two second order section mainly as
( )= + 1+ + 1+ + + + +

( )=

The matching difference equation is given bellow. The equation defines how the filtering process is carried out. Filter part one 1 ( )= ( ) Filter part two ( )= ( ) ( )= ( )= ( )

( 1)

( 1)

( 2) +

( 1)

( )

( 1)

( 1)

( 2)

( 1)

16

A310SE Advance Digital System | Faazil fairooz Realization diagram

Above is a Matlab Simulink model that was generated by the code that is on page 23 For high quality image and Simulink design file please refer coursework CD

17

A310SE Advance Digital System | Faazil fairooz Our next stage comprises of selecting the best paring order, this is a crucial stages because the correct value of the aij and bij will be directly depended on how we pair up the denominator and numerator polynomials of H(z). Step 4: Analysis of the effect of finite word length on filter performance Here we will review the faults that could occur due to different quantization errors. This is all so done to assess the best configuration to implement in terms signal to signal ratio Overflow error This is a common cause for filter failure; if we do not see it, it might become a problem. To avoid any overflow at the output of the adders suitable scale factors are added as. The fourth order filter is split into two second order section ( )= ( )= ( )= ( )= ( ) ( ) ( ) ( )

( ) ( )

( ) ( )

Where

( ) ( )

( ) ( )

( ) ( )

( ) ( ) +

( ) = 1 + 0.675 718

( ) = 1 + 1.649 656 ( ) = 1 0.495 935 ( ) = 1 0.829 328

+ 0.761 864 + 0.307 046

18

A310SE Advance Digital System | Faazil fairooz


Scale factors for the four filters

Filter A B C D

Scale factor S1 S2 S1 S2 S1 S2 S1 S2

L1 5.524 844 11.821 571 2.479 158 18.908 47 2.479 158 11.821 571 5.524 844 18.908 47

L2 1.608 890 3.677 381 1.359 467 10.880 490 1.359 467 10.880 490 1.608 890 5.727 459

L 4.379 544 7.262 393 2.175 539 12.548 114 2.175 539 7.262 393 4.379 544 12.548 114

Round off errors, As to the above data the four filters will have completely different scaling factors here we will find the round off errors which is directly connected to the signal to noise performance of the filter both round off and overflows are connected to each other. Using the finite word length analysis scale factors based on the L1 norm L2 norm, L norm for the four possible filters above were obtained and are summarized in the above table. We have used the L1 norm for a fourth order filter realization cascade of the two second order canonic sections, the round off noise at the output, after scaling is given by = 3 ( ) ( ) 2 2 2 ( ) + 3 +5 2 2 2

Where q is the quantization step size or rounding, . symbolizes the L2 norm squared H1(z) is the transfer function for the first stage, H2(z) is the transfer function for the second filter filter stage The noise performance of the circuit is mentioned bellow Filter A B C D Noise Power 703q2 326.378 q2 382.32 q2 570.453 q2
19

12

stage,S1 is scaled factor for the first filter stage and s2 is the scale factor for the second stage

A310SE Advance Digital System | Faazil fairooz As from the above filter we can clearly see that B has the best noise to power ratio, therefore the filter transfer function will be rescaled to the B parameters Rescaled transfer function

H(z) = H (z) = = 0.1311136

= 10.880 490

1 + 1.649 656 + 1 0.829 328 + 0.307 046

s N (z) s D (z)

N (z) s D (z)

1 + 0.675 718 + 1 0.495 935 + 0.761864

Step 5: Implementation of filter in hardware or on software


Filters frequency response This frequency spectrum could only be plotted of a computer emulation system therefore Matlab has been used for the design of the filter response For the Design Matlabs fdatool (Filter design and analysis tool) has been used

20

A310SE Advance Digital System | Faazil fairooz


The M-file that is required has been developed

Matlab Code files (M-file generated)


function Hd = frequency response %FREQUENCY RESPONSE Returns a discrete-time filter object. % M-File generated by MATLAB(R) 7.7 and the Signal Processing Toolbox 6.10. % Generated on: 01-Sep-2013 19:31:02 % Elliptic Lowpass filter designed using FDESIGN.LOWPASS. % All frequency values are in Hz. Fs = 15000; % Sampling Frequency N = 4; % Order Fpass = 3000; % Passband Frequency Apass = 0.5; % Passband Ripple (dB) Astop = 45; % Stopband Attenuation (dB) % Construct an FDESIGN object and call its ELLIP method. h = fdesign.lowpass('N,Fp,Ap,Ast', N, Fpass, Apass, Astop, Fs); Hd = design(h, 'ellip'); % [EOF]

21

A310SE Advance Digital System | Faazil fairooz

Method two

All calculations are done in radians please select RAD mode in calculator SI UNITS
decibels or linear {Hz, KHz, MHz, GHz}.

DEFINITIONS
Magnitude units Frequency units Pass band edge frequency Pass band attenuation (or gain) Stop band edge frequency Stop band attenuation (or gain

Step 1
Find the stop band and pass band edge frequency 1. pass band = tan 2 2 3000 2 15000

= tan 2. Stop band edge frequency

= 0.72654

= tan

= tan

2 2 3450 2 15000
22

= 0.88161

A310SE Advance Digital System | Faazil fairooz

3. Frequency Prewrapping = = 0.88161 0.72654

STEP 2

= 1.213

Filter order identification 1. Stop-band 10


2. Pass-band

= 31,621.776 10 10 log
.

10

3. Low pass filter prototype =1

= 5.41362

31,621.776 0.1220

0.1220

= 1.213 log = 2 log(1.213) = 0.16772

23

A310SE Advance Digital System | Faazil fairooz

Therefore value of N could be generated 5.41362 0.16772

= 32.375

STEP 3

= 33

1. Poles identification of the prototype Butterworth filter

= cos

(2 + 1) 2

+ sin

(2 + 1) 2

= cos

(2 + 2 1) 4
. .

+ sin

= =

2 2 + 2 2 2 2 + 2 2 =

(2 + 2 1) 4

2. S plane Transfer function H(s) ( )=

3. Frequency Scaled s-plane transfer function ( )= ( ) = =

1 )(

+ 2 + 1 1

+ 2

5 +

+ 2

+1

24

A310SE Advance Digital System | Faazil fairooz Applying BTZ for the equation ( )= ( ) = 1 +1 + 2 1 +1 + ( + 1)

( + 1) + 2

( 1)( + 1) +

( + 1)

After Simplification and dividing the top and bottom by Z2 we will arrive at ( )= 1+2 +

+ 2

1+

2 1 1 + 2 +

1 2 1 2

4. Now the quotation is substituted with required parameters to find the coefficient Equation Set 1 = 0.72654

= 1 + 2 (0.72654) + (0.72654) = 2.55534 1

1 + 2

= (0.72654) 1 = 0.47213

Equation Set 1 1 2 +

= 1 2 (0.72654) + (0.72654)
25

A310SE Advance Digital System | Faazil fairooz = 0.50037 = (0.72654)

Coefficient calculations We can now apply the transfer function and start solving it ( )= 1+2 +

= 0.527860

+ 2

+ ( )=

1+

As our filter has N=33 it will be a tremendous job to get the other filter coefficients therefore we will plot this value in Matab using the fdatool syntax to generate the filter coefficient. And from there we can export the Coefficient value from the Matab interface the steps are as follows

) 0.527860(1 + 2 + 1 0.36960 + 0.19599

2 1 1 + 2 +

1 2 1 2

Fdatool

From options Select Decimal

Click Export

Input Filter value to filter designer

Select Coefficent File (ASCII)

Give location and Save

Go to file

Export

26

A310SE Advance Digital System | Faazil fairooz Generated M-file as follows

% % Generated by MATLAB(R) 7.7 and the Signal Processing Toolbox 6.10. % % Generated on: 10-Sep-2013 19:33:26 % Coefficient Format: Decimal % % % % % % Discrete-Time IIR Filter (real) ------------------------------Filter Structure : Direct-Form I, Second-Order Sections Number of Sections : 17 Stable : Yes Linear Phase : No 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -0.14281070474322588 -0.28625363409365423 -0.28816571443951267 -0.29138676810315733 -0.29604212580563954 -0.30264098964502451 -0.29511693733862598 -0.29720427164431629 -0.42408676573713555 -0.19020205232706641 -0.19070060983583659 -0.71726731791926612 -0.015539620506256568 -0.015535035017088694 -1.3713875207328945 0.22697592369204805 0.22697700874573506 0 0.022662524949377746 0.029506703984561275 0.041046817134428204 0.05756010692961832 0.078595114478602915 0.10918970551018559 0.12210961218762116 0.13611237350521715 0.17530384196735768 0.1760030633131548 0.21086998854482847 0.30331420268622605 0.30337188635846879 0.52358920125839969 0.64240734009488232 0.6424099208325692

SOS matrix: 1 -1.0000000000009226 0 1 -8.6144576009953511 18.890977297635043 1 -7.6498910445406603 17.204369109331168 1 -6.0800927387010155 14.475528623434085 1 -4.3135872137071276 11.468495098292504 1 -2.5801089331313158 8.4920026997804587 1 -1.0843049095147497 5.6930418534730336 1 -0.051220351303893019 3.2965976550978038 1 0.35332101010832256 1.5566416024928107 1 -0.45600910240262726 0.052935323792280699 1 -0.44464815860385076 0.058124770144926716 1 -0.37612495595649459 0.087195398472268093 1 -0.30382808676716389 0.11775785234069869 1 -0.1904614329949782 0.17565302095731977 1 -0.42002560991144744 0.069082105812547853 1 -0.015537337782544319 0.30334305384657068 1 0.22697646622242285 0.6424086304769987 Scale Values: 0.000000064522581650416606

27

A310SE Advance Digital System | Faazil fairooz

Software Implementation

28

A310SE Advance Digital System | Faazil fairooz

Matlab Program for Calculations of Filter Coefficient and Plot Frequency Response Spectrum
Design a linear FIR band pass Design Parameters Passband Stop band ripple Passband ripple Sampling frequerncy Transition width Parameter value 7-11 KHz 0.002 0.01 42 KHZ 3 KHz

Method one

Designing Steps using Matlab fdatool The FIR could be built by using matlabs in built digital filter design and analysis tool box commonly known as (fdatool ) this tool has the capacity to model and designing 95 percent of todays filters in the industry Magnitude-frequency response using hamming window
Step 1

Type fdatool in Matlab Command window

29

A310SE Advance Digital System | Faazil fairooz

Step 2 Using Optimal Window method

Input Cct parameters

Select Chebyshev from drop list

Select FIR and Window from drop list

Matlab Code files (M-file generated)


function Hd = Optimal %OPTIMAL Returns a discrete-time filter object. % M-File generated by MATLAB(R) 7.7 and the Signal Processing Toolbox 6.10. % Generated on: 11-Sep-2013 02:06:50 % FIR Window Bandpass filter designed using the FIR1 function. % All frequency values are in Hz. Fs = 42000; % Sampling Frequency N = 33; % Order Fc1 = 7000; % First Cutoff Frequency Fc2 = 11000; % Second Cutoff Frequency flag = 'scale'; % Sampling Flag SidelobeAtten = 0.5; % Window Parameter % Create the window vector for the design algorithm. win = chebwin(N+1, SidelobeAtten); % Calculate the coefficients using the FIR1 function. b = fir1(N, [Fc1 Fc2]/(Fs/2), 'bandpass', win, flag); Hd = dfilt.dffir(b); % [EOF]

30

A310SE Advance Digital System | Faazil fairooz Using Kaiser Window method

Input Cct parameters

Select Kaiser from drop list Select FIR and Window from drop list

Matlab Code files (M-file generated)


function Hd = Kaiser code %KAISER CODE Returns a discrete-time filter object. % M-File generated by MATLAB(R) 7.7 and the Signal Processing Toolbox 6.10. % Generated on: 01-Sep-2013 18:18:29 % FIR Window Bandpass filter designed using the FIR1 function. % All frequency values are in Hz. Fs = 42000; % Sampling Frequency N = 58; % Order Fc1 = 7000; % First Cutoff Frequency Fc2 = 11000; % Second Cutoff Frequency flag = 'scale'; % Sampling Flag Beta = 0.5; % Window Parameter % Create the window vector for the design algorithm. win = kaiser(N+1, Beta); % Calculate the coefficients using the FIR1 function. b = fir1(N, [Fc1 Fc2]/(Fs/2), 'bandpass', win, flag); Hd = dfilt.dffir(b); % [EOF]

31

A310SE Advance Digital System | Faazil fairooz Step 3 Representations of magnitude-frequency response of

Kaiser window

Hamming window

32

A310SE Advance Digital System | Faazil fairooz

Method Two

Designing Steps without using Matlab fdatool Using Kaiser Window method Matlab code generated without fdatool syntax
FS = 42000; FN = FS/2; N = 58; beta = 4.60; fc1 = 7000/FN; fc2 = 11000/FN; FC = [fc1 fc2]; hn = fir1(N-1,FC,kaiser(N,beta)); [H f]= freqz(hn,1,512,FS); mag = 20*log10(abs(H)); plot(f,mag),grid on Xlabel('Frequency (Hz)') Ylabel('Magnitude Response (dB)')

Kaizer Output wave form

33

A310SE Advance Digital System | Faazil fairooz Using Optimal Window method Matlab code generated without fdatool syntax
Fs=48000; dp=0.01; ds=0.001; M=[0 1 0]; F=[5000 8000 12000 15000]; dev=[ds dp ds]; [N1 F0 M0 W]=remezord(F,M,dev,Fs); [b delta]=remez(N1,F0,M0,W); [H f]=freqz(b,1,512,Fs); mag=20*log10(abs(H)); plot(f,mag),grid on Xlabel('Frequency (Hz)') Ylabel('Magnitude Response (dB)')

Optimal Output wave form

34

A310SE Advance Digital System | Faazil fairooz

CCS Program to Implement the Digital Filter on Chip

CCS compiler is used by many designer in building and programming MCUs and Pic based systems the system is capable of converting Matab M file in to machine code and the it is also capable of embedding the final code into the system The process of Building a ccs program will be shown in steps for easy understanding and then illustrated in image format
File Process line up

For Kaiser

Load Matlab

select File and load Kaiser M-file

Run Kaiser.m file

type dsk_fir67(hn) in Matlab syntax loadee -Fx

"enter filename for coefficients" matlab will reply please type Kaiser cof

Open CCS Compiler

Click "debug"

Click "connect" this will the DSP Board to the software

Click "project""Open"

select Source File name"firprnbuf.c" from side slide bar

locate and Rename "# include" with Kaiser.cof

copy Kaiser. cof and replace "Project Open File"

From File select "Load program"

Load program "Firprnbuf.out" file

Select "Projects""Rebuild All"

Slect "Veiw""Graph"

You will be directed to graph properties

Click OK

File Process line Up For Optimal


Load Matlab select File and load Kaiser M-file Run Kaiser.m file

type dsk_fir67(dev) in Matlab syntax loadee -Fx

"enter filename for coefficients" matlab will reply please type optimal. cof select Source File name"firprnbuf.c " from side slide bar

Open CCS Compiler

Click "debug"

Click "connect" this will the DSP Board to the software

Click "project""Open"

locate and Rename "# include" with optimal .cof

copy Kaiser. cof and replace "Project Open File"

From File select "Load program"

Load program "Firprnbuf.out" file

Select "Projects""Rebuild All"

Slect "Veiw""Graph"

You will be directed to graph properties

Click OK

35

A310SE Advance Digital System | Faazil fairooz Screenshots For Kaiser Windows

1.

2.
36

A310SE Advance Digital System | Faazil fairooz

3.

4.

37

A310SE Advance Digital System | Faazil fairooz

5.

6.

38

A310SE Advance Digital System | Faazil fairooz

7.

8.

39

A310SE Advance Digital System | Faazil fairooz

9.

10.

40

A310SE Advance Digital System | Faazil fairooz

11.

12.

41

A310SE Advance Digital System | Faazil fairooz Screenshots for Optimal Windows Please note only three frames would change and the other stages are as same as before

1.

2.
42

A310SE Advance Digital System | Faazil fairooz

3.

43

A310SE Advance Digital System | Faazil fairooz

Real Time Implementation

44

A310SE Advance Digital System | Faazil fairooz

Emulation results for the Filter design


depicted Output wave generated at the conditions
Sampling Frequency Pass band frequency Transition Width Pass band ripple Stop band ripple

The output wave form was generated the wave is magnitude response graph full image is

42000Hz 7000-11000Hz 3000Hz 0.02dB 0.002dB

Kaiser Real-time Wave generated out of CCS Compiler

45

A310SE Advance Digital System | Faazil fairooz


Optimal window Real-time Wave generated out of CCS Compiler

Comparison
Both the wave forms were scaled at the same time instance.

Kaiser Waveform

Optimal Waveform

When we start compare we must first understand that the both the waveforms what were generated we equiripple type therefor both the these types are extensively used in areas like the Optimal method is more suited than Kaiser Form in the field of audio processing therefore optimal is more used in sub-woofer sets The optimal method of calculating a FIR coefficient is more powerful and flexible because of its excellent design program, Due to this reason this method is given more prominence by designers and being used in many FIR applications, Where as in the other hand Kaiser waveform is more robust and accurate but is not so prominent between designers is because it not that flexible and sometimes it is thrown out of balance due to this reason most Kaiser designed systems are used at lower level applications And the other distinct feature is that it could be observer in the output waveforms is that the ripple peaks that are formed in these frequencies are formed very close to the frequency edges on the other hand called edge frequencies decreases away from the band edges. A clear supposition could be achieved is that the ripples are evenly dispersed throughout the pass band and stop band frequencies. Therefore the Optimal method is more equiripple that the Kaiser method The major setback of the optimal method is also more evident that is the waveform generated by the optimal method it is hard to find the location of the extremely frequency, whereas the Kaiser method is more visual friendly and more mathematically workable without sophisticated lab equipments and experiments.

46

A310SE Advance Digital System | Faazil fairooz

Conclusion
Methodologies
One regular technique for designing FIR filters is the Parks-Mcclellan Filter design calculation, in light of the Remez exchange calculation. Here the client indicates a coveted frequency response, a weighting capacity for errors from this reaction, and a filter order N. The calculation then discovers the set of N coefficients that minimize the greatest deviation from the perfect. Instinctively, this discovers the filter that is as close as you can get to the coveted reaction given that you can utilize just N coefficients. This strategy is especially simple in practice and no less than one incorporates a system that takes the desired filter and N and gives back where its optimum coefficients. One conceivable disservice to filters designed thusly is that they hold numerous modest ripples in the passband(s), since such a filter minimizes the errors

Solution Implementation

As we can see matlabs fdatool has been extensively used in the design process where it is easier to work on a more user friendly system building up complex codes. Firstly all necessary values were read out and carefully inputted to the fdatool system and there onwards everything is automated, all waves there on generated we double checked manually and using online design tools.

Results achieved

All results we checked manually calculated and Mablabs extensive programing helped us most on the way. We have achieved many milestones as we have got an identical waveform which most of the computer simutaions provide

47

A310SE Advance Digital System | Faazil fairooz

Reference
Book Reference Emmanuel Ifeachor, 2001. Digital Signal Processing: A Practical Approach (2nd Edition). 2 Edition. Prentice Hall. Alan V. Oppenheim, 1999. Discrete-Time Signal Processing (2nd Edition) (Prentice-Hall Signal Processing Series). 2 Edition. Prentice Hall. Journal Reference Kuruoglu, Ercan E., 2013. Digital Signal Processing. Digital Signal Processing, Volume 23, Issue 5, , 58. Analogue Devices, Analogue Devices, 1988. ADSP-2100 . ADSP-2100 family application handbook , Volume 2/Chapter 3, 17-45. Website wikipedia.org. 2011. Kaiserwindow. [ONLINE] Available at: http://en.wikipedia.org/wiki/Kaiser_window. [Accessed 04 September 13]. Pravin Singh. (). Digital Signal tool box. Available: http://www.mathworks.com/matlabcentral/newsreader/view_thread/321227. Last accessed 20-8-2013 Matlab . (2012). DSP. Available: http://www.mathworks.in/dsp/. Last accessed 01-08-2013. Tony Fisher . 1999. Interactive Digital Filter Design. [ONLINE] Available at: http://wwwusers.cs.york.ac.uk/~fisher/mkfilter/. [Accessed 01 September 13]. Lockheed Martin . 2013. information technology . [ONLINE] Available at: http://www.lockheedmartin.com/us/what-we-do/information-technology.html. [Accessed 01 September 13]. wikipedia.org. 2013. FIR . [ONLINE] Available at: http://en.wikipedia.org/wiki/Finite_impulse_response. [Accessed 02 September 13].
48

A310SE Advance Digital System | Faazil fairooz Tony Robinson. 2010. Finite Impulse Response filters. [ONLINE] Available at: http://svrwww.eng.cam.ac.uk/~ajr/SA95/node13.html. [Accessed 08 September 13]. Desertion TAPIO SARAMAKI, T., 2008. Finite Impulse Response Filter Design. MSC. Tampere, Finland: Department of Electrical Engineering. Tampere University of Technology. . Wu Binbin ; Zhang Wei ; Suh Heejong, Zhang Ke, 2010. The Application of the IIR Filters Based on FPGA in the DTV Field. Bsc. Beijing, China : Coll. of Inf. Eng., Beijing Inst. of Petrochem. Technol.,. F.. Yassa, J. Jasica, et al. A silicon compiler for digital signal processing: Methodology, implementation, and applications. Proc. IEEE, 75(9):1272-1282, Sep 1987. M. P. Leong, Craig T. Jin, and Philip H. W. Leong. An FPGA-based Electronic Cochlea. EURASIP Journal on Applied SignalProcessing, (7):629{638, 2003

49

You might also like