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.

Regarding the input frequency estimation through complex samples using Xilinx FFT IP core

Status
Not open for further replies.

Maitry07

Full Member level 2
Full Member level 2
Joined
Jun 29, 2022
Messages
130
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,165
Hello support team,

I have tried to implement the Xilinx FFT IP core as below.
I samples data format: FIX16_15
Q samples data format: FIX16_15
FFT window:1024
Sample rate: 20.48 MSPS
Output: unscaled
Output number of bits: 0 to 63 ( out of which 58 to 32 bits represent XK_IM and 26 to 0 bits represent XK_Re)
I have attached the screenshot of the same.

Now as per xilinx user guide, The index(xk_index: m_axis_data_user ) should be taken into account at which we are getting the highest peak amplitude of FFT output.

In the screenshot,
My input frequency is 3 MHz,
Highest peak index: 150

Frequency estimation = (Sample rate* index)/FFT window = (20.48 *10^6 *150)/1024 = 3 MHz

So, in this way I am getting the correct result. right now, I have verified it through the ILA.

But my actual requirement is to figure out the index value from the peak amplitude and take it further this index value to estimate the frequency. and then there is one fix frequency value (let's say 32 MHz ) needs to be added to the estimated 3 MHz frequency. so could you please suggest what kind of algorithm i can use to search for the correct index out of the total 1024 window?
 

Attachments

  • FFT measurement for 3 MHz_DDC.PNG
    FFT measurement for 3 MHz_DDC.PNG
    34.5 KB · Views: 292

How comes 32 MHz into play? What has it to do with peak search problem?

Peak can be identified in different ways, e.g. simple maximum, center of gravity with or without threshold filter. Choose based on intended resolution, signal-to-noise ratio, peak width.
 

Hello support team,

I have tried to implement the Xilinx FFT IP core as below.
I samples data format: FIX16_15
Q samples data format: FIX16_15
FFT window:1024
Sample rate: 20.48 MSPS
Output: unscaled
Output number of bits: 0 to 63 ( out of which 58 to 32 bits represent XK_IM and 26 to 0 bits represent XK_Re)
I have attached the screenshot of the same.

Now as per xilinx user guide, The index(xk_index: m_axis_data_user ) should be taken into account at which we are getting the highest peak amplitude of FFT output.

In the screenshot,
My input frequency is 3 MHz,
Highest peak index: 150

Frequency estimation = (Sample rate* index)/FFT window = (20.48 *10^6 *150)/1024 = 3 MHz

So, in this way I am getting the correct result. right now, I have verified it through the ILA.

But my actual requirement is to figure out the index value from the peak amplitude and take it further this index value to estimate the frequency. and then there is one fix frequency value (let's say 32 MHz ) needs to be added to the estimated 3 MHz frequency. so could you please suggest what kind of algorithm i can use to search for the correct index out of the total 1024 window?
(20.48 *10^6)/1024 = 20 KHz
hence each bin is 20 KHz starting from dc bin as 0 the 20KHz then 40KHz.
If it helps.
 

How comes 32 MHz into play? What has it to do with peak search problem?

Peak can be identified in different ways, e.g. simple maximum, center of gravity with or without threshold filter. Choose based on intended resolution, signal-to-noise ratio, peak width.
Hello,

Sorry for the confusion. The above two are different questions.
1st question: Peak search method
2nd question: After figuring out the index value from the peak search and estimation of frequency, I need to add the fixed frequency of 32 MHz to the estimated frequency.

One more thing, I have observed that in order to have more resolution with lower latency, if I can reduce the input data sample rate to a minimum then it will be possible to use a higher FFT window. Is my understanding correct?
For example, If I reduce my input sample rate to 1 MSPS.
Fs=1 MSPS, N=4096, Then frequency resolution would be 244 Hz between 2 indexes.

So, Is this the above suitable way to get the higher resolution, lower latency? If yes, then what is the best way to reduce the input sample rate ?
 

(20.48 *10^6)/1024 = 20 KHz
hence each bin is 20 KHz starting from dc bin as 0 the 20KHz then 40KHz.
If it helps.
Yes, I got your point. but in my case my input frequency would be unknown. so I need to figure out the index for the peak amplitude only.
--- Updated ---

Sampling frequency must fulfill Nyquist criterion to get non-ambiguous results.
Yes, actually my input is pure sine wave( no modulation). and my ADC to generate the digital data fulfills the nyqist criteria. But as my input sample rate to FFT IP core is higher such 20.48 MSPS. I am thinking to use counter to reduce the sample rate to 1 MSPS to get the higher resolution with lower FFT window . as lower FFT window will provide lower latency.
 

Oh , no , now I got what are you trying to say. No my DDC input frequency range to FFT IP core would be within 2-4 MHz. , i.e maximum 4 MHz frequency estimation should be detected. so, for the FFT IP core I could use minimum sample rate of 8 MSPS? right
 

Hi,

And how would you add 32MHz then? .. in a system that is limited to (below) 4MHz?

Klaus
 

Hi,

And how would you add 32MHz then? .. in a system that is limited to (below) 4MHz?

Klaus
Actually, my purpose is to estimate DDC frequency ( which will be in the range of 2-4 MHz). the 32 MHz addition is the NCO frequency(which here I have given as an example), the NCO frequency would be known to me . so by adding that, it is possible to estimate actual RF input frequency.
 

Actually, my purpose is to estimate DDC frequency ( which will be in the range of 2-4 MHz). the 32 MHz addition is the NCO frequency(which here I have given as an example), the NCO frequency would be known to me . so by adding that, it is possible to estimate actual RF input frequency.
so you want to offset back the NCO to get RF frequency. What stopped you identifying the bin index then convert it to frequency as index * 20 KHz then add 32MHz (in circuit or by hand on paper). You need extra care about negative frequency bins.
 

In the paper, it is possible. but my actual RF input will be varying within +/-1 MHz . so identifying the bin index will be variable every time my input frequency varies. so how to continuously estimate the correct one? because what I see from the FFT core latency, with 1024 FFT window, the latency is around 3 usec.
that means, the FFT IP core itself will take 3 usec to provide the output, after that peak identifying algorithm will also take some time. in between if my input frequency varies, then what is the best way to continuously estimate the correct variable frequency?
 

In the paper, it is possible. but my actual RF input will be varying within +/-1 MHz . so identifying the bin index will be variable every time my input frequency varies. so how to continuously estimate the correct one? because what I see from the FFT core latency, with 1024 FFT window, the latency is around 3 usec.
that means, the FFT IP core itself will take 3 usec to provide the output, after that peak identifying algorithm will also take some time. in between if my input frequency varies, then what is the best way to continuously estimate the correct variable frequency?
I am lost now...
if your tone changes while fft is running your design will fail.
Can you give the figures for:

ADC sampling rate.
DDC sampling rate if different from ADC (e.g. up or down sampled)
fft size (1k)
fft sampling rate if different from ADC/DDC.
system clock rate
expected tone variation time (jitter)
 

Hello,

Below is the figures.
ADC sample rate: 1966.08 MSPS
DDC sample rate: down sample to 61.44 MSPS
DDC output frequency: 2-4 MHz ( based on the input frequency variation)
FFT size: 1024
FFT input sample rate: (further down sample to 20.48 MSPS)
my system reference clock is 122.88 MHz, ADC sample rate generation, there is one inbuilt PLL.
Expected tone variation time(jitter): I am not sure about it. I need to check. right now,I have only that information that it will vary in between +/-1 MHz.
 

Hello,

Below is the figures.
ADC sample rate: 1966.08 MSPS
DDC sample rate: down sample to 61.44 MSPS
DDC output frequency: 2-4 MHz ( based on the input frequency variation)
FFT size: 1024
FFT input sample rate: (further down sample to 20.48 MSPS)
my system reference clock is 122.88 MHz, ADC sample rate generation, there is one inbuilt PLL.
Expected tone variation time(jitter): I am not sure about it. I need to check. right now,I have only that information that it will vary in between +/-1 MHz.
your main concern is processing time of FFT and peak detection.
Your fft if running on system clock will take more than 3 us since 1000/122.88*1024 = 8333 ns.
However your 1024 samples would arrive at 20.48 Msps i.e. this is more restrictive than fft time. it will take 1000/20.48*1024 = 50000 ns

You need to determine First the processing time that you need and if 1024 FFT really needed. It gives 20KHz resolution. Can you do with smaller FFT or even try DFT targeting few frequencies.
 

ok, I got your point. my fft clock is 20.48 mhz only. 1 sample per clock
To reduce processing time I suggest you go faster on FFT and/or reduce fft size:

processing time = 1000/Fs* FFT size (ns)
Hence it gets less if FS is high or FFT size small.
 

ok, I got your point. my fft clock is 20.48 mhz only. 1 sample per clock
Have you considered a PLL feedback approach instead of FFT?
1) design an NCO to start at at expected frequency
2) compare nco phase with that of RF input to get loop error.
3) use feedback to adjust NCO increment value.
Then the NCO increment value will reflect the difference from starting ref frequency

This is very fast tracking and well known. Requires some modelling work first.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top