필터 지우기
필터 지우기

FFT HDL Optimized block output is different from FFT block output

조회 수: 3 (최근 30일)
Milruwan
Milruwan 2016년 7월 20일
댓글: Milruwan 2016년 8월 4일
Hi... Everyone, I need to implement a n point fft on a Fpga. So, for the testing purpose I have created a simulation model to test the output of the n point fft and ifft model. The output from the n-point FFT HDL Optimized block is different from FFT block output. Whats going wrong with this simulation? How do I need to modify the model?
Simulink model
Configuration is as follows.
1. Created a sine wave with following parameters.
2. Parameters of FFT HDL Optimized block
3. Parameters of IFFT HDL Optimized block
4. Parameters of FFT block
5. Figure of FFT HDL Optimized block output
6. Figure of IFFT HDL Optimized block output
7. Figure of FFT block output
Above (Figure of FFT block output) is the desired output. But fft/ifft hdl optimized outputs gives a wrong result. Please help me on this problem.
Thank You!

답변 (3개)

Alireza
Alireza 2016년 7월 20일
Hi Milruwan, The spectrum analyzer takes the FFT of the input signal, which means that what you are looking at is the FFT of an FFT. The error between FFT (set the FFT implementation to radix 2 inside the FFT block) and HDL Optimized FFT is of order e-14, or e-15 if you are concerned about the mismatch between these two blocks. To see the spectrum you need to save the data in a "To Workspace" and plot the result for 32 samples. Here is what I modified in your model to plot and also calculate the error.
Inside the subsystem there is a Spectrum analyzer and To Workspace block.
The error will be: simout.signals.values(:,1,1) - simout1.signals.values(:,1,1)
and you can plot stem(abs(simout.signals.values(:,1,1))) The result will be
  댓글 수: 1
Milruwan
Milruwan 2016년 7월 21일
편집: Milruwan 2016년 7월 21일
Thanks for the help Alireza, I got the point. But without observing the fft of fft through the spectrum analyzer, I get the fft of the signal and do the ifft to observe the output in the time domain. Still the output is distorted. What is the reason?
simulink model is in the zip file.

댓글을 달려면 로그인하십시오.


Bharath Venkataraman
Bharath Venkataraman 2016년 7월 21일
To connect the fft to the ifft, you also need to connect the valid out port of the fft to the valid in port of the ifft. Likewise, to observe the output of the ifft, use the valid out port to control an enabled subsystem that contains the time scope.
  댓글 수: 1
Milruwan
Milruwan 2016년 8월 4일
Hi Bharath Venkataraman, Thanks for the answer. After connecting the valid input to the valid out model is working fine.

댓글을 달려면 로그인하십시오.


Alireza
Alireza 2016년 7월 20일
In your model, you send one sample at a time to FFT and FFT HDL optimized. FFT zero pads the input data to create a frame the same size as FFT length (in this case 32). However in FFT HDL Optimized, zero padding doesn't happen. Therefore the result is different. If you set the "Sample per frame" property in Sine Wave block to 32, you will see the same result.
  댓글 수: 1
Milruwan
Milruwan 2016년 7월 20일
Hi Alireza, Thanks for the answer. I set the "Sample per frame" property in Sine Wave block to 32, But still the output is wrong. Spectrum is not a 100 Hz fft output.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Transforms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by