CWT Filter Bank Function

조회 수: 4 (최근 30일)
Ameen Bin Obadi
Ameen Bin Obadi 2020년 7월 6일
댓글: Ameen Bin Obadi 2020년 7월 7일
Dears, I am trying to to use HDL coder to convert some matlab code to VHDL. among the fucntions to be converted is teh "cwtfilterbank" , part of the code inside this function the follwoing:
I ran into error which is ( ??? Variable sized properties in handle classes are only supported when dynamic memory allocation is enabled. This operation defines 'cwtfilterbank.Omega' as double[1 x :?]. Please consider enabling dynamic memory allocation.) can any one know how go around this by specifying the variable size.
function self = FrequencyGrid(self)
% This method constructs the frequency grid to compute the
% Fourier transforms of the analyzing wavelets
N = self.SignalLength+2*self.SignalPad;
omega = (1:fix(N/2));
omega = omega.*(2*pi)/N;
omega = [0, omega, -omega(fix((N-1)/2):-1:1)];
self.Omega = omega;
self.Frequencies = self.SamplingFrequency*self.Omega./(2*pi);
end

답변 (1개)

Kiran Kintali
Kiran Kintali 2020년 7월 7일
Generating code FPGA cannot support variable dimensions as HDLCoder needs to generate code for a chip with fixed size, type, dimensions, complexity and rates.
Please provide your problem as dut.m (design under test) and dut_tb.m (test bench driving dut) for further guidance on the topic.
  댓글 수: 1
Ameen Bin Obadi
Ameen Bin Obadi 2020년 7월 7일
Thanks Kiran. I will share the dut and dut_tb files . I undesrtand the error is about having a variable size of one of the variables which is not supported by HDL , we have 2 solutions:
1- Enabling dynamic memory alllocation: Which I do not know how to do it in HDL coder , I can access it in Matalb coder but no such prperty I found in HDL coder (of course thsi will be my prefered solution if can be done)
2- specifying a fixed size fo rthe variable: this varible is in the code above, spceifically in this line
(self.Omega = omega;) , the above code is part of the matlab function (cwtfilterbank) which I used in my dut.m file . so if there is a way to manipulate this function to have a fixed size, the problem is solved.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by