Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FFT computation in matlab for a data captured from scope

Status
Not open for further replies.

dkumar

Member level 3
Joined
Jan 4, 2008
Messages
65
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,889
FFT computation.

Hi all,

I have some question regarding FFT computation in matlab for a data captured from scope. The situation is explained below:

I have a track and hold circuit ( in silicon) and i am testing is by giving some input frequency say Fin and sampling clock say Fs. ( it is actually doing sub sampling). Now i take the output of T/H to oscilloscope (TDS7104 which has spec. 1GHz and 10GS/s) and see the track and hold action ( attached is a screen capture ) . Now i save this data for some matlab processing and plot it back in matlab. I want to take the FFT of this Track and hold to see SFDR and SNDR. But i am not sure how will i do this?

Please let me know how can i take FFT in this case?

Also, should i be taking FFT using only the hold points in the plot or using the entire T/H output?

Please help me out in understanding this. Thanks a lot and looking forward to some help.
 

Re: FFT computation.

You should take only the hold points. If you take everything, it'll be a mess and you won't get any useful information.
In Matlab there is a function fft that does the discrete/fast fourier transform depending on the number of points that you provide for it. It is good if you can sample integer number of periods of your output sine wave.
 

Re: FFT computation.

hi..thanks for reply.
so as you said i should be getting only the hold portion , that makes sense.
At the same time ,for the fft function in matlab , say i take 1024 point fft then i need to have at least 1024 'hold portion' from the measurement right?

thanks.
 

Re: FFT computation.

dkumar said:
for the fft function in matlab, say i take 1024 point fft then i need to have at least 1024 'hold portion' from the measurement right?
That is correct (one hold point per sample). You should also have an integer number of input cycles in your 1024 samples (better if you have an odd number). In order to do this correctly, you need to lock your signal source with your clock generator using the 10MHz sync in the back of the boxes.
 

Re: FFT computation.

HI,
Yeah, i understand the relation of input frequency and sampling frequency being:

Fin/Fs = n/M , and also the reason for n being odd/prime. But when you say i have to lock the signal source with clock generator using 10Mhz sync at the back of the boxes , where do you get this 10Mhz number? and by boxes i guess you mean the signal generator?

thanks

Added after 13 minutes:

also, say my sampling frequency is 20MHz and input frequency is close to 100Mz ( approx. = 20Mz*(5119/1024) ) .

Now i use the signal generator ( that has this 10Mhz input at the back) to make sure i have integer number of cycle in my sampling clock, how will this 10Mhz signal make sure of that? and from where will i get this 10Mhz signal/clock. I am using AWG to generate these clock signals of 20MHz , so should i use AWG to generate this 10Mhz also? or should this 10Mhz be derived from 20Mhz sampling clock? and why is this 10Mhz ?
 

FFT computation.

The 10MHz reference is a standard input/output for signal/clock generators. Two connectors are usually in the back of the box and are often called REF IN and REF OUT. You need to connect the REF OUT of the clock source to the REF IN of the signal source in order to guarantee that the PLLs inside the generators use the same time base (the 10MHz reference).

I hope this helps.
 

Re: FFT computation.

hi,
yeah , i understood that, but i have one more question then,

when we take fft, we maintain the ration of fin to fs equal to m/M where m and M are coprime numbers with M = 2^n.

so now say that my system is for subsampling, and fs = 20Mhz and i need input to be around 100Mhz for 4096 point fft.
using the clock generator i generated 20MHz clock and i also sync. the signal generator using 10MHz reference at the back of boxes. Now i need fin such that

fin/20M = m/4096 with m being a prime number right? which would give me 20480 for fin = 100MHz and for m to be prime i choose 20479 thus choosing fin = 99.99512Mhz ( close to 100Mhz and lying in the bin = 20479) but now when i try to generate this fin from the signal generator , and see both the clock and signal in scope with triggering from the clock waveform, the other one keeps moving.

I feel that even if i use this 10Mhz reference , i will not be able to trigger both clock and signal at the same time unless they both have frequency in multiples of each other.

please help me clarify this if i am mistaken

thanks.
 

FFT computation.

I am not 100% sure (and I do not have matlab with me now), but I believe you need to set m=20480 in order to have an integer number of cycles in your capture. This is because in one clock period you have exactly 5 signal cycles. If you decrease the signal frequency, you will not have an exact ratio.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top