code of notch filter

9 Ansichten (letzte 30 Tage)
nsprt nsprto
nsprt nsprto am 12 Nov. 2013
Kommentiert: Sumit am 11 Mai 2023
Can any one help me how I can do notch filter in matlab?

Antworten (3)

Jan
Jan am 12 Nov. 2013
Isn't this a nice question for an internet search engine?

Honglei Chen
Honglei Chen am 13 Nov. 2013
There is an example in the documentation

Kiran
Kiran am 26 Dez. 2022
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 Kommentar
Sumit
Sumit am 11 Mai 2023
hello, i want design such filter for ECG signal which is in the .wav file. how i do this ?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by