To Study and design the Hamming window filter using the DSP TMS320F28335 in code composer studio.




SOFTWARE REQUIRED: Code Composer Studio (Version: 8.0)

HARDWARE REQUIRED: DSP controller board (TMS320F28335), JTAG, XDS100V2 board

THEORY:

The window method for digital filter design is fast, convenient, and robust, but generally suboptimal. It is easily understood in terms of the convolution theorem for Fourier transforms, making it instructive to study after the Fourier theorems and windows for spectrum analysis. It can be effectively combined with the frequency sampling method.

The window method consists of simply ``windowing'' a theoretically ideal filter impulse response h(n) by some suitably chosen window function w(n).

By using window filter, we design 5 types of filters:

1. Rectangular 2. Bartlett 3. Hanning 4. Hamming 5. Blackman

Embedded ‘C’ CODE for LED Blinking:


 

   

 

#include<math.h>

#include<stdio.h>

 

float x[80];

double hd[11], W[11], h[11], y[90];

 

void main()

{

    int i,j,f=50,fs=100;

    double t,p;

 

    double ts=0.001;

    double w=2*3.1416*f;

    double wc=2*3.1416*f/fs;

 

    for(i=0;i<80;i++)

    {

       t=i*ts;

       x[i]=1*sin(w*t)+.33*sin(3*w*t)+.2*sin(5*w*t)+.14*sin(7*w*t);

    }


for(i=0;i<11;i++)

    {

        if(i==5)

            hd[i]=wc/3.1416;

  else

            hd[i]=sin((i-5)*wc)/(3.1416*(i-5));

 

        W[i]=0.54-0.46*cos(2*3.1416*i/(11-1));

        h[i]=hd[i]*W[i];

    }

 

    for(i=0;i<80+11-1;i++)

    {

        y[i]=0;

        for(j=0;j<11;j++)

        {

            if(i-j<0||i-j>=80)

                p=0;

            else

                p=x[i-j];

 

            y[i]=y[i]+h[j]*p;

        }

    }

}

        

WAVEFORMS:


                                                  

Fig 1: Input signal waveform


Fig 2: FFT analysis of Input signal waveform 

                                                       

  Fig 3: Desired filter waveform

 

Fig 4: FFT analysis of Desired filter response waveform


Fig 5: Window function waveform

 

Fig 6: FFT analysis of Window function waveform

 

                                     

Fig 7: final filter impulse response waveform

 

                                      

Fig8: FFT analysis of final filter impulse response waveform

 

                                      

Fig 9: Output waveform after eliminating Harmonics

 

Fig 10: FFT analysis of Output waveform after eliminating Harmonics

 

Conclusion: We Obtained the output response of hamming window filter using the DSP TMS320F28335 in code composer studio and the graphs plotted is displayed.

 

Post a Comment

Please do not enter any spam links in the comments...

Previous Post Next Post