Hi! I need to implement a real-time DFFT on an FPGA to obtain the frequency spectrum of a current signal. I'm new in the use of Vivado and FPGA implementation. Instead of using directly Vivado Software (version 2021.2) I used Simulink (Matlab 2020b), since, it is more intuitive for me. I have read the FFTCORE 9.1 manual to understand how the configuration works (https://www.xilinx.com/support/documents/ip_documentation/xfft/v9_1/pg109-xfft.pdf) and I have been working with a simulation that found on YouTube, which I modified to make it a little simpler (I attach the file I made).
However, I have had problems with being able to correctly find the magnitude and phase of the test signal. I don't know why the magnitude of the two frequencies found is the same.
How should I configure the blocks so that the magnitudes displayed are correct?
This is the spectrum obtained by the simulink application (powergui, not for vivado application), although, this is the signal before inserting the binary dot ,
but, i have this graphics from fft and cordic core
Where the magnitude obtained for one memory cycle,
The frequency shown is fine, both are 1000 and 9000 Hz but the magnitudes do not have to be the same and their values do not have much to do with the amplitude of the signal.
Can someone here give me a hand? I'm new to this world of FPGA.
-The sample time of the simulation is 1.25 us.
-The ADC sample time is 100 us.
-The input data type used in the FFT real and imaginary part is Fix16_15 and the imaginary input is a constant 0.
The configuration of the blocks are:
FFT core:
CORDIC ATAN:
In this part, I calculate the Data Width whit this:
As the FFT configuration is Unscaled:
Bxk = 16 + log_2(4096) + 1 = 29
And I assumed that the binary point was located the same as in the input.
I don't know what could be wrong. I've been thinking about it several times, until I decided to consult here.
Any advice on how to configure it correctly?
Sorry If something is not understood or is not good write, I am using translator to write this message.
PD: The video that I used as an example is as follows:
FFT_example_v6.slx fft_script_example.m