Digital Signal Processing Reference
In-Depth Information
A.5.4 MATLAB Program f 51_3
%Digital Signal Processing:A Practitioner's Approach
%Dr.Kaluri Venkata Ranga Rao, kaluri@ieee.org
%Generates figure 5.14
clear; clf;
load f513.dat;
x1=f513(:,1);
y1=f513(:,2);
y2=f513(:,3);
t=1:length(y1);
s=20; e=90;
subplot(221)
plot(t,x1);grid;
title(' A ');xlabel(' Samples ');ylabel(' Input ');
subplot(222)
plot(t(s:e),y1(s:e),'.',t(s:e),y2(s:e));grid;
title(' B ');xlabel(' Samples ');ylabel(' Output ');
A.5.5 C Program f 51_2
# include
<
stdio.h
>
# include
<
stdlib.h
>
# include
>
# include "f512matfun_f.c"
# include "f512dsp.c"
<
math.h
void main (void)
{
// test variables
int k;
int kmax = 2000;
float theta=20.0,f,yk,xk,pi;
float pk[3] = {0.1,0.1,0};
FILE *fp_write;
fp_write = fopen("f512.dat", "w");
f=theta/360.0;
pi = (atan(1.0))*4.0;
// randomise();
// printf(" start \n");
for (k=0; k
<
kmax; k++)
{
Search WWH ::




Custom Search