필터 지우기
필터 지우기

Converting MATLAB code to Arduino code

조회 수: 8 (최근 30일)
Ricky Sidlowski
Ricky Sidlowski 2019년 3월 27일
댓글: madhan ravi 2019년 3월 27일
I need to convert this code made in MATLAB for use using the Arduino program which I believe uses C code. I am not sure how to do so and any help will be apreciated! It is for filtering data a data set.
function Hd = Lowpass_2
%LOWPASS_2 Returns a discrete-time filter object.
% MATLAB Code
% Generated by MATLAB(R) 9.5 and Signal Processing Toolbox 8.1.
% Generated on: 08-Mar-2019 11:28:05
% Equiripple Lowpass filter designed using the FIRPM function.
% All frequency values are in Hz.
Fs = 100; % Sampling Frequency
Fpass = 0.4; % Passband Frequency
Fstop = 0.45; % Stopband Frequency
Dpass = 0.057501127785; % Passband Ripple
Dstop = 0.0001; % Stopband Attenuation
dens = 20; % Density Factor
% Calculate the order from the parameters using FIRPMORD.
[N, Fo, Ao, W] = firpmord([Fpass, Fstop]/(Fs/2), [1 0], [Dpass, Dstop]);
% Calculate the coefficients using the FIRPM function.
b = firpm(N, Fo, Ao, W, {dens});
Hd = dfilt.dffir(b);
% [EOF]
  댓글 수: 1
madhan ravi
madhan ravi 2019년 3월 27일
Have a look into Embedded coder and MATLAB coder.

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

답변 (1개)

Mark Sherstan
Mark Sherstan 2019년 3월 27일

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by