1 # Octave script to plot Fortran FFT output sequence from file.
 2 fid=fopen("abs.txt","r");
 3 [v1,count]=fscanf(fid,'%f',[32, Inf]);
 4 fclose(fid);
 5 x=0:1:31;
 6 pi=3.14159;
 7 t=[0:1/64:1];
 8 xs = sin(2*pi*5*t);
 9 subplot(2,1,1);
10 plot(t,xs);
11 title("Test of DIF FFT with 5-hz sine input");
12 xlabel("t (seconds)");
13 ylabel("amplitude");
14 subplot(2,1,2)
15 stem(x,v1,"r");
16 text(15,0.45,"|X(f)| output");
17 ylabel ("|X(f)|");
18 xlabel ("frequency (hz)");
19 axis([0,31,0.0,0.55]);
20 print -dpng fft_nov28.png;