How to use the dsp.HDLIFFT system object?
Show older comments
I am developing a symple OFDM modulator. I use QPSK symbols as input for the IFFT block (dsp.HDLIFFT). The problem is that my system is not working correctly, sometimes I receive the expected data and sometimes I don´t. I tested the QPSK alone and It works fine. But, when I put together the dsp.HDLIFFT wiht the QSPK modulador the system suffers the above problem.
Exampl of the problem:
A ===> [QPSK,IFFT] ====> B (CORRECT) 1st Test
A ===> [QPSK,IFFT] ====> C (INCORRECT) 2nd Test
A ===> [QPSK,IFFT] ====> D (INCORRECT) 3rd Test
A ===> [QPSK,IFFT] ====> E (INCORRECT) 4th Test
A ===> [QPSK,IFFT] ====> B (CORRECT) 5th Test
The system works fine sometimes but as you can see above I receive wrong data most of the time.
My system object defination is:
ifft128 = dsp.HDLIFFT('FFTLength',128,'ResetInputPort',true);
My code is something like this:
funciton tx = transmitter(rx)
UART_RX_funcion call
MAIN_FUNCTION call
UART_TX_function call
%%%%%%%%%%%%%%%%%%%%
[outputs] = main_fsm(inputs)
persistent a b c ifft128 ...
if isempty(a)
ifft128 = dsp.HDLIFFT('FFTLength',128,'ResetInputPort',true);
end
switch(state)
state1
state2
state3
end
[yOut,validOut] = step(ifft128,yIn,validIn,resetIn);
11 Comments
Alireza
on 23 Feb 2017
Hi, Would you please provide your test bench and your code that I can try it? One minor thing in your main_fsm: You have a persistent called 'a'. It is never assigned but you look at it to create your fft object (if isempty(a) ...). since 'a' is not assigned, there will be a new ifft128 object each time you call this function. Is this intentional? Usually we write if isempty(ifft128) ...
Ali
Pablo Medina
on 23 Feb 2017
Alireza
on 24 Feb 2017
Hi, To be able to reproduce the mismatch that you mentioned on your first post, I need the whole test bench. I couldn't reproduce the result with the code that you provided.
Pablo Medina
on 24 Feb 2017
Pablo Medina
on 24 Feb 2017
Alireza
on 24 Feb 2017
What do you mean by "implement"? HDL code generation and running in hardware?
Pablo Medina
on 25 Feb 2017
Alireza
on 27 Feb 2017
If it passes the RTL simulation (running HDL simulator), then the problem might be timing. You need to check if your design meet the timing is Xilinx.
Pablo Medina
on 30 Mar 2017
Alireza
on 3 Apr 2017
You need to have a timing constraint when you synthesize, and make sure that the design meet the timing. Check the clock frequency of your design and create a timing constraint based on the clock frequency. After the synthesis and place and route, check if the design meet the timing.
Pablo Medina
on 21 Apr 2017
Answers (0)
Categories
Find more on HDL Code Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!