function res = doph() % 20 ns Samplinginterval = 50 MHz Sampling Frequency dt = 20E-9; %Sample interval Fs = 1/dt; %Sampling Frequency Ns = 64; %Number of Samples to Compute freq = 6.25E6; % Frequency of the sinewave %freq = 6E6; t = 0:dt:(Ns-1)*dt %t = 0:dt:1023*dt; p = freq*t; % phase is scaled by 1/(2*pi) pm = mod(p,1.00); %Modulo phase y = sin(2*pi*pm); figure(1) clf plot(p,y,'-o'); hold on plot(p,pm,'-o'); % Power Spectrum figure(2) clf pspectrum(y,Fs) %pspectrum(y,Fs,'Leakage',1) % FFT s = fft(y/Ns); figure(3) stem(abs(s)); res = y; end