fftshift implementation in Simulink
4 ビュー (過去 30 日間)
古いコメントを表示
I need to generate IPs for HDL implementation of an algorithm. I need to do fftshift in simulink but there is no fftshift block avaiable. Is there any way we can do fftshift of the output data from FFT block from DSP HDL toolbox? I am attaching FFT model for reference.
採用された回答
Walter Roberson
2025 年 1 月 23 日
Fork the fft output. Use https://www.mathworks.com/help/dsp/ref/variableselector.html variable selector block on each of the branches, with Fixed selector. In one of the branches select 1:floor(signal_length)/2 and in the other branch select floor(signal_length)/2+1:signal_length . Now concatenate those two together in reverse order.
This potentially requires hard-coding the signal length.
3 件のコメント
Walter Roberson
2025 年 1 月 24 日
good point
x = 1:9;
signal_length = numel(x);
fftshift(x)
[x(ceil(signal_length/2)+1:signal_length), x(1:ceil(signal_length/2))]
Paul
2025 年 1 月 24 日
I just realized that this block requires the FFT length to be a power of 2, so the ceil() isn't necessary for this particular use case.
参考
カテゴリ
Help Center および File Exchange で Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!