% v1107Plot(fn, offset, Nfft) % % Read and plot a real-valued auto-correlation spectrum % produced by swspectrometer % % fn : file name and path % offset : the number of the spectrum to read when the % file contains several % Nfft : number of FFT points used earlier to generate % the file % function v1107Plot(fn, offset, Nfft) if(offset<1), offset = 1, end Nssb=floor(Nfft/2) + 1; fs=16e6; fd=fopen(fn, 'rb', 'l'); for jj=(1:offset), ydata=fread(fd, [Nssb 1], 'float32'); fprintf(1, 'Read from offset %d\n', jj); end xdata=fs * (1:Nssb)/Nfft; semilogy(xdata, ydata); fclose(fd); end