How to generate HDL code for 2-D matrices

4 ビュー (過去 30 日間)
Shravankumar P
Shravankumar P 2014 年 6 月 28 日
編集済み: Shravankumar P 2014 年 7 月 1 日
I am working on HDL code gen project. I've designed an FFT algorithm , and trying to generate HDL code for that. But the algorithm consisting of matrix of inputs , twiddle factors and their multiplications which are of two dimensional matrices. HDL coder is unable to generate code for 2-D matrices.
What do I need to do to generate HDL code for my Algorithm.
Example: Use Cooley-Tukey Divide and Conquer Technique of FFT Computation.
R1(16,4) = x(16,4) * w4(4,4);
R2(16,4) = w16(4,4) .* R1(16,4);
Y(16,4) = R2(16,4) * w(4,4) ;
x= input; Y=output;w4w16,w4 are twiddle factors.
  3 件のコメント
the cyclist
the cyclist 2014 年 6 月 30 日
編集済み: the cyclist 2014 年 6 月 30 日
Shravankumar, maybe we weren't clear enough when we asked for examples. Although the conceptual background is helpful, what is the most useful is one or two specific, numerical example of the input and output that you expect.
What is the size and shape of x, w4, and w6? Give a specific example, but clear enough that we can infer the general rule for the multiplication.
Shravankumar P
Shravankumar P 2014 年 7 月 1 日
The Computaion of Matrices as follows :
R1(16,4)= x(16,4) * w4(4,4);
R2(16,4)= w16(4,4) .* R1(16,4);
Y(16,4) = R2(16,4) * w(4,4) ;
Dimensions of the matrices indicated in the Brackets (m,n)
My Reference is the Book:
Digital Signal Processing, 4/E John G. Proakis, Northeastern University Dimitris K Manolakis, Massachusetts Institute of Technology, Lincoln Laboratory
Chapters:
7 The Discrete Fourier Transform: Its Properties And Applications
8 Efficient Computaiton Of The Dft: Fast Fourier Transform Algorithms

サインインしてコメントする。

採用された回答

Tim McBrayer
Tim McBrayer 2014 年 6 月 30 日
You are correct that HDL Coder does not support matrix multiplication directly. You can always decompose the matrix multiplication to the scalar operations that it is comprised of, though.
The FFT is a commonly used algorithm within HDL Coder. Many of the shipping examples in the product documentation involve FFTs. It sounds like perhaps this is an academic project, and that you cannot simply use the shipping examples. Perhaps, however, you can gain some insight on how to perform the math that you need to from the examples provided.
FFT Using Simulink Blocks:
web(fullfile(docroot, 'hdlcoder/examples/fft-using-simulink-blocks.html'))
Using the Minimum Resource HDL FFT:
web(fullfile(docroot, 'hdlcoder/examples/using-the-minimum-resource-hdl-fft.html'))
OFDM Receiver with 512-Point Serial FFT
web(fullfile(docroot, 'hdlcoder/examples/ofdm-receiver-with-512-point-serial-fft.html'))
OFDM Receiver with 512-Point Streaming I/O FFT
web(fullfile(docroot, 'hdlcoder/examples/ofdm-receiver-with-512-point-streaming-i-o-fft.html'))
  1 件のコメント
Shravankumar P
Shravankumar P 2014 年 7 月 1 日
Thank you very much sir, you got my question. thanks again.

サインインしてコメントする。

その他の回答 (1 件)

the cyclist
the cyclist 2014 年 6 月 28 日
Is this what you mean?
Bvec = 1:9;
B = reshape(3,3);
A = B';
C = A*B;
If not, then my suggestion is the same as Azzi's. A simple example or two of the input/output you expect would be very helpful.
  1 件のコメント
Shravankumar P
Shravankumar P 2014 年 6 月 30 日
Sir, I've updated my question ,check it again. thank you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by