Lab Task

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

DSP LAB TASK

TASK1:
Aim: To design an FIR High Pass Filter using code composer on
TMS320C6745.
Algorithm:
1. Input the order and cutoff frequency of the filter.
2. Find the values of the transfer function at every interval.
3. Build & debug the program and run it.
4. Add the required Expression and observe the waveform on graph.
CODE :
#include<stdio.h>
#include<math.h>
inti,w,wc,c,N;
float H[100];
floatmul(float , int );
void main()
{
printf("\n Enter order of IIR hpf Filter:");
scanf("%d",&N);
printf("\n Enter the CutoffFreq ");
scanf("%d",&wc);
for(w=0;w<100;w++)
{
H[w]=1/sqrt(1+mul(((float)wc/w),2*N));
printf("H[%d]=%f\n",w,H[w]);
}
}
floatmul(float a,int x)
{
for(i=0;i<x-1;i++)
a*=a;
return(a);
}

OUTPUT :

TASK2 :
Aim: To design a FIR Low Pass Filter.
Algorithm:
1. Input the order and cut off frequency of the filter.
2. Find the values of the transfer function at every interval.
3. Build & debug the program and run it.
4. Add the required Expression and observe the waveform on graph.
CODE:
#include<stdio.h>
#include<math.h>
inti,w,wc,c,N;
float H[100];
floatmul(float, int);
void main()
{
printf("\n Enter order of IIR LP Filter:");
scanf("%d",&N);
printf("\n Enter the CutoffFreq ");
scanf("%d",&wc);
for(w=0;w<100;w++)
{
H[w]=1/sqrt(1+mul((w/(float)wc),2*N));
printf("H[%d]=%f\n",w,H[w]);
}
}
floatmul(float a,int x)
{
for(i=0;i<x-1;i++)
a*=a;
return(a);
}

OUTPUT:

You might also like