Dear,
This is my code.
numpt=512; % points
fclk=256e6; % sampling frequency
load saradcdata1.txt; % Load data from disk;
for i=1:512;
code(1,i)=saradcdata1(i,2);
end
window=hamming(numpt);
Doutw=code'.*window;
Dout_spect=fft(Doutw);
Dout_dB=20*log10(abs(Dout_spect));
figure;
maxdB=max(Dout_dB(1:numpt/2));
plot([0:numpt/2-1].*fclk/numpt,Dout_dB(1:numpt/2)-maxdB);
grid on;
title('FFT PLOT');
xlabel('ANALOG INPUT FREQUENCY (MHz)'); ylabel('AMPLITUDE (dB)');
My picture is below.
I have a question.
You can see (1) and (2).
My signal is 1.5M. My clock is 256M.
What produce (1) and (2).
Is my code wrong?
or why?
(1) is produced by the large DC offset in your data.
(2) is produced by a small high-frequency signal in your data. Origin unknown, but it may be a distortion product between the sample rate and the 1.5 MHz main signal.
To remove the DC offset (and to fix a subscript error), try changing this:
code(1,i) = saradcdata1(i,2);
to this:
code(1,i) = saradcdata1(i,1) - mean(saradcdata1);
(1) is produced by the large DC offset in your data.
(2) is produced by a small high-frequency signal in your data. Origin unknown, but it may be a distortion product between the sample rate and the 1.5 MHz main signal.
To remove the DC offset (and to fix a subscript error), try changing this:
code(1,i) = saradcdata1(i,2);
to this:
code(1,i) = saradcdata1(i,1) - mean(saradcdata1);
Dear all,
When I do FFT, I have some question.
M is total number of sin wave periods.
N total sampling points.
Ft sine wave frequency.
Fs DAC sampling rate.
I am doing to measure SFDR of my dac.
1.why Ft/M=Fs/N?
2.why M and N must be prime
3.why M must be integer
4.My picture has some problems like (1)(2).why??
This picture is produced.
1.5MHz/3=256MHz/512.
Thanks.
ilter, I don't know why your second plot shows 0Hz at only -30dB. I get a much lower amplitude. However, your second plot looks like a different data set. Are you removing the DC offset?
I'm no expert in SFDR, so I'll defer that question to other folks.
ilter, I don't know why your second plot shows 0Hz at only -30dB. I get a much lower amplitude. However, your second plot looks like a different data set. Are you removing the DC offset?
Yes
I'm no expert in SFDR, so I'll defer that question to other folks.
Dear all,
When I do FFT, I have some question.
M is total number of sin wave periods.
N total sampling points.
Ft sine wave frequency.
Fs DAC sampling rate.
I am doing to measure SFDR of my dac.
1.why Ft/M=Fs/N?
2.why M and N must be prime
3.why M must be integer
4.My picture has some problems like (1)(2).why??
This picture is produced.
1.5MHz/3=256MHz/512.
Thanks.
Hi.
let me first explain your third question. If M set to a non-integervalue, let's say 3.2, then this uncomplete period would be repeated in FFT calculation in order to build a periodic signal. Hence the resulting waveform would have a lot of distortion and final SNDR will be degraded dramatically. On the other hand, M and N must be prime to each other, in order to obtain N different (non-identical) points of the signal. otherwise, the SNDR would be overestimated. and why Ft/M = Fs/N? Let me write it in this way : Ft/Fs = M/N. this is the main concept of FFT calculation.