found unsupported dynamic matrix type at output port 0
Ältere Kommentare anzeigen
hi. I am working on Fast Fourier transform here i am converting FFT into HDL code. While converting i am getting error " Found unsupported dynamic matrix type at output port :0 i.e is z. My code is as below
function z=Fast_Fourier_Transform(x,nfft)
N=length(x);
z=complex(zeros(1,nfft));
Sum=complex(0);
for k=1:nfft
for jj=1:N
a=-2*pi*(jj-1)*(k-1)/nfft;
a1=cos(a)+1j*sin(a);
Sum=Sum+x(jj).*a1;
end
z(k)=Sum;
Sum=0;% Reset
end
return
testbench:
Fs = 150; % Sampling frequency
t = 0:1/Fs:1;
f = 5;
nfft = 1024;
x= cos(2*pi*t*f);
z=Fast_Fourier_Transform(x,nfft);
z = z(1:nfft/2);
mx = real(z);
% Frequency vector
f = (0:nfft/2-1)*Fs/nfft;
% Generate the plot, title and labels.
figure(1);
plot(t,x);
title('Sine Wave Signal');
xlabel('Time (s)');
ylabel('Amplitude');
figure(2);
plot(f,mx);
title('Power Spectrum of a Sine Wave');
xlabel('Frequency (Hz)');
ylabel('Power');
In workflow advisor i am getting error at last point i.e near hdlcode generation step. code is not reaching at this point and error is at same place
for jj=1:N
a=-2*pi*(jj-1)*(k-1)/nfft;
a1=cos(a)+1j*sin(a);
Sum=Sum+x(jj).*a1;
end
I am unable to debug this error please do help for my further process. THANK YOU
Akzeptierte Antwort
Weitere Antworten (1)
Tim McBrayer
am 11 Apr. 2016
Bearbeitet: Tim McBrayer
am 11 Apr. 2016
The size of z is clearly dependent on the value of an input variable:
z=complex(zeros(1,nfft));
Try it with an actual constant instead of nfft, and see how it goes.
2 Kommentare
Amruta Radder
am 14 Apr. 2016
Keerthi Venkat Reddy Mokka
am 13 Mär. 2018
can you please tell me... what are the changes you did in your code?
Kategorien
Mehr zu AMD FPGA and SoC Devices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!