@Walter Roberson
Sir, Here is the code
clc; load('100m.mat'); %100.m data from physionet ECG = (val-0)/200; fs = 360; %sampling frequency t = (0:length(ECG)-1)/fs; %time period(total sample/Fs ) plot(t,ECG, 'k'); xlabel('Samples'); ylabel(' Amplitude [mV] '); title( 'Heart beat' ); hold on; % legend('ECG Signal'); % %%figure(); %Time domain ploting % subplot(411); plot(t,ECG, 'k'); axis([0 10 -1.5 1.5]); grid on; xlabel(' Samples '); ylabel(' Amplitude [mV] '); title(' Original ECG Signal '); %Time domain ploting %figure();
- * Item one
- * Item two
%% %% Generationg Power line interference (noise) signal = ECG; %original ecg signal fNoise = 50; % Frequency [Hz] aNoise = 0.20; % Amplitude noise = aNoise*sin(2*pi.*t.*fNoise); % subplot(412); plot(t, noise, 'k'); % %legend('PLI'); grid on; axis([0 10 -1.5 1.5]); xlabel(' Time [s] '); ylabel(' Amplitude [mV] '); % title(' 50Hz Power Line Intereference (PLI) '); %%figure();
%% %% 50Hz Noise adding with the Original ECG Signal Noisy_Signal = (signal + noise); % subplot(412); plot(t, Noisy_Signal, 'k'); grid on; axis([0 10 -1.5 1.5]); xlabel(' Samples '); ylabel(' Amplitude [mV] '); title(' ECG Signal with 50Hz PLI'); % figure();
%% %%Spectral analysis of the ECG signal with 50Hz noise (PLI)signal L = length(Noisy_Signal); NFFT = 2^nextpow2(L); noise_fft = abs(fft(Noisy_Signal,NFFT)); %%% creating frequency axis freq = fs/2*linspace(0,1,NFFT/2+1);
%%%%% plot single-sided amplitude spectrum of % subplot(2,3,4); subplot(411); plot(freq,noise_fft(1:NFFT/2+1)); grid on; axis([0 500 0 500]); title('Single-Sided Amplitude Spectrum of ECG Signal with 50Hz PLI'); xlabel('Frequency (Hz)'); ylabel('|Amplitude, Y(f)|'); % figure();
% % %% % % FIR Low_pass filter design fs1=1000; fc=100; Wc = fc/(fs1/2); %cut_off frequency N = 40; % N= order of filter b = fir1(N,Wc,'low',rectwin(N+1)); % Rectangular window % % freqz(b,1,1024,fs1); % frequency response of FIR LPF filter in Hz % % freqz(b,1,512); % frequency response of FIR LPF filter in radian. % % fvtool(b,1); % % %%figure(); % %% %% filter the noisy signal f_fir = filter(b,1,Noisy_Signal); % subplot(513); % plot(t,f_fir); % reconstructed_Signal = f_fir; % grid on; % title(' Rectangular window filtered signal '); % Rectangular window % xlabel(' Samples '); % ylabel(' Amplitude [mV]'); % axis([0 10 -1.5 1.5]); %%figure()
Actually I am trying but can not understand the clearly thats why I am asking Because in matlab command there are two input signal.but I want to try for each signal MSC 1. Original ECG signal 2. Noisy_ECG signal 3. Filtered ECG Signal
3 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/503737-plotting-spectrogram-for-eeg-data#comment_793756
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/503737-plotting-spectrogram-for-eeg-data#comment_793756
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/503737-plotting-spectrogram-for-eeg-data#comment_793777
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/503737-plotting-spectrogram-for-eeg-data#comment_793777
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/503737-plotting-spectrogram-for-eeg-data#comment_1310872
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/503737-plotting-spectrogram-for-eeg-data#comment_1310872
Sign in to comment.