code of notch filter

21 次查看(过去 30 天)
nsprt nsprto
nsprt nsprto 2013-11-12
评论: Sumit 2023-5-11
Can any one help me how I can do notch filter in matlab?

回答(3 个)

Jan
Jan 2013-11-12
Isn't this a nice question for an internet search engine?

Honglei Chen
Honglei Chen 2013-11-13
There is an example in the documentation

Kiran
Kiran 2022-12-26
clc
clear all
close all;
load 231m
data1=(val(1,:));
% data=data1/200;
data=(data1-1024)/200;
EKG=data;
% D = load('Sara Cooper ecgNoise.mat');
% EKG = D.DD2; % Signal
L = length(EKG); % Signal Length (samples)
Fs = 300; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
t = (0:L-1)/Fs; % Time Vector (sec)
figure(1)
plot(t, EKG)
grid
axis([0 3 ylim])
FTEKG = fft(EKG)/L; % Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
figure(2)
semilogy(Fv, abs(FTEKG(Iv))*2)
grid
axis([0 7.5 ylim])
Fs = 300; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
Wp = [1 100]/Fn; % Passband (Normalised)
Ws = [0.5 110]/Fn; % Stopband (Normalised)
Rp = 10; % Passband Ripple (dB)
Rs = 30; % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp, Ws, Rp, Rs); % Chebyshev Type II Order
[b,a] = cheby2(n, Rs, Ws); % Transfer Function Coefficients
[sos,g] = tf2sos(b,a); % Second-Order-Section For Stability
EKG_F = filtfilt(sos, g, EKG);
figure(3)
plot(t, EKG_F)
grid
axis([0 3 ylim])
title('Star Strider’s Bandpass Filtered EKG')
xlabel('Time (sec)')
ylabel('Amplitude (mV?)')
  1 个评论
Sumit
Sumit 2023-5-11
hello, i want design such filter for ECG signal which is in the .wav file. how i do this ?

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by