image thumbnail

EMG Electromiógrafo

by

 

Diseño E Implementación De Un Electromiógrafo Mediañte Matlab

PasaBanda.m
function Hd = PasaBanda
%Ejemplo para utilizar la funcion:
%FP=PasaBanda; %se almacena el filtro en una variable FP
%fvtool(FP)  %para visualizar el filtro
%OutFiltPass=filter(FP,y);  % aplicar el filtro FP a una seal de entrada Y
%%plot(OutFiltPass) % para ver la seal filtrada

% Equiripple Bandpass filter designed using the FIRPM function.

% All frequency values are in Hz.
Fs = 1000;  % Sampling Frequency

Fstop1 = 4;               % First Stopband Frequency
Fpass1 = 7;               % First Passband Frequency
Fpass2 = 400;             % Second Passband Frequency
Fstop2 = 410;             % Second Stopband Frequency
Dstop1 = 0.0001;          % First Stopband Attenuation
Dpass  = 0.057501127785;  % Passband Ripple
Dstop2 = 0.0001;          % Second Stopband Attenuation
dens   = 20;              % Density Factor

% calcular el orden de los parmetros usando FIRPMORD.
[N, Fo, Ao, W] = firpmord([Fstop1 Fpass1 Fpass2 Fstop2]/(Fs/2), [0 1 ...
                          0], [Dstop1 Dpass Dstop2]);

% calcular los coeficientes usando la funcin FIRPM
b  = firpm(N, Fo, Ao, W, {dens});
Hd = dfilt.dffir(b);

% [EOF]

Contact us