Thursday, June 11, 2015

MATLAB Test for Function Generator

We outputted a sine wave from the function generator at 9Hz and came up with the following plots using the following MATLAB code:

x = [
5333

55354

52449

6093

32767

32767

32767

8453

55195

52430

7259

32767

32767

32767

7356

55003

52422

8294

32767

32767

32767

6573

54890

52453

9227

32767

32767

32767

5892

54785

52461

9899

32767

32767

32767

5232

54684

52454

10570

32767

32767

32488

4680

54588

52451

11259

32767

32767

31989

4065

54512

52494

11959

32767

32767

31536

3527

54430

52537

12559

32767

32767

31071

2980

54343

52575

13303

32767

32767

30446

2162

54228

52639

14426

32767

32767

29509

1061

54059

52807

15771

32767

32767

28598

46

53948

53083

17019

32767

32767

27629

64459

53802

53489

18242

32767

32767

26818

63590

53675 ]

t=linspace(0,.00004,100);
f=1./t
figure(1)
plot(t,x)

z=fft(x)
figure(2)
plot(f,z)



***The time interval is certainly incorrect for the values shown in figure 1 (amplitude vs. time)***

 *** We expect one large peak for the plot of the FFT of the array x. This is because an FFT transforms a function from time space into frequency space to show amplitude as a function of frequency.
The next goal in the process is to have the SDK code include lines that perform the FFTs directly in the hardware of the Zedboard, eliminating the use for a computer. The results of these can be used/combined for further analysis.

No comments:

Post a Comment