How to convert matlab code to VHDL code?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SRI
am 10 Sep. 2014
Kommentiert: priyanka shinde
am 8 Apr. 2020
How to convert matlab code to VHDL code?
Thanks In Advance
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (2)
Asad Aleem
am 2 Feb. 2017
In order to translate a Matlab code to HDL, all you have to do is to utilize HDL code. HDL coder is an extension of Matlab. I have checked its working on Matlab 16b.
0 Kommentare
priyanka shinde
am 8 Apr. 2020
clc ;
clear all;
close all;
xn=input('Enter the sequence=');
N=input('Enter the value of N=');
Xk=dft_fun(xn,N);
disp(Xk)
k=0:N-1;
subplot(2,1,1)
stem(k,abs(Xk))
xlabel('k')
ylabel('|Xk|')
title('Magnitude Plot')
subplot(2,1,2)
stem(k,angle(Xk))
xlabel('k')
ylabel('angle(Xk)')
title('Phase Plot')
function Xk=dft_fun(xn,N)
L=length(xn);
if(N<L)
error('N should always be greater than or equal to L')
end
xn=[xn zeros(1,N-L)];
for k=0:N-1
for n=0:N-1
Wn=exp(-j*2*pi*n*k/N);
X1(k+1,n+1)=Wn;
end
end
Xk=X1*xn';
1 Kommentar
Siehe auch
Kategorien
Mehr zu HDL Coder finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!