marufsust
Newbie level 6
Hi all,
I am trying to convert the following code into verilog... First i want to sure that the following MATLAB Code can be converted into Verilog HDL
%%%%%%%%%%%%
clc
clear all
% Load data -----------------------------------
[fname, path] = uigetfile('*.txt','Open data file');
patient_data = fname(1:end-4);
p = -textread([path fname]);
N = length(p);
sr = 100; % Sampling rate
t = (1:N)'/sr;
% -----------------------------------------------
% Finding all beats of 2nd derivative -------
f = gradient(gradient(p));
dt = .5; % Minimal pulse period
d = 10*median(abs(f)); % Amplitude threshold
n = find(f(1:end-1)<d & f(2:end)>d);
n = n(diff/sr>dt);
% Finding local minimums and maximums
for j = 1: length-1
[Amax(j),ind] = max(f(n(j):n(j+1)));
imax(j) = n(j)-1+ ind;
[Amin(j),ind] = min(f(n(j):n(j+1)));
imin(j) = n(j)-1+ ind;
end
% -----------------------------------------------
% The median b/a parameter value is here
b_a = -median(Amin./Amax);
%%%%%%%%%%%%%%%
The deadline is very near so please help me to figure our whether it can be converted into Verilog . If possible how? If no then why?
Thanx
I am trying to convert the following code into verilog... First i want to sure that the following MATLAB Code can be converted into Verilog HDL
%%%%%%%%%%%%
clc
clear all
% Load data -----------------------------------
[fname, path] = uigetfile('*.txt','Open data file');
patient_data = fname(1:end-4);
p = -textread([path fname]);
N = length(p);
sr = 100; % Sampling rate
t = (1:N)'/sr;
% -----------------------------------------------
% Finding all beats of 2nd derivative -------
f = gradient(gradient(p));
dt = .5; % Minimal pulse period
d = 10*median(abs(f)); % Amplitude threshold
n = find(f(1:end-1)<d & f(2:end)>d);
n = n(diff/sr>dt);
% Finding local minimums and maximums
for j = 1: length-1
[Amax(j),ind] = max(f(n(j):n(j+1)));
imax(j) = n(j)-1+ ind;
[Amin(j),ind] = min(f(n(j):n(j+1)));
imin(j) = n(j)-1+ ind;
end
% -----------------------------------------------
% The median b/a parameter value is here
b_a = -median(Amin./Amax);
%%%%%%%%%%%%%%%
The deadline is very near so please help me to figure our whether it can be converted into Verilog . If possible how? If no then why?
Thanx