diff options
-rw-r--r-- | matlab/dds/doph.m | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/matlab/dds/doph.m b/matlab/dds/doph.m new file mode 100644 index 0000000..f4e0175 --- /dev/null +++ b/matlab/dds/doph.m @@ -0,0 +1,30 @@ +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
\ No newline at end of file |