Where I can find ECG data with heart rate that i can use in matlab?? I do not find a data with heart rate in physionet
MATLAB: ECG data heart rate
ecgecg dataheart rate
Related Solutions
I don't know a lot about DICOM images, but a possibility is to use
dicomread imresize dicomwrite
in that order.
I will help you out a bit with the signal processing, and I will let you do the heart rate and all other necessary calculations:
fidi = fopen('Biza Ferreira ecg16.txt', 'rt');Data = textscan(fidi, repmat('%f', 1, 11), 'Delimiter','\t', 'CollectOutput', 1, 'HeaderLines',8);fclose(fidi);Fs = 1000; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
Ts = 1/Fs; % Sampling Interval (sec)
EKG = Data{:}(:,4); % EKG Data
T = [0:size(EKG,1)-1]*Ts; % Time Vector
Rp = 5; % PAssband Ripple (dB)
Rs = 25; % Stopband Ripple (dB)
Wp = [2 50]/Fn; % Normalised Passband Frequencies
Ws = Wp.*[0.2 1/0.2]; % Normalised Stopband Frequencies
[n,Wn] = buttord(Wp, Ws, Rp, Rs); % Calculate Butterworth Filter Order
[b,a] = butter(n,Wn); % Calculate Butterworth Filter Coefficients
[sos,g] = tf2sos(b,a); % Convert To ‘SOS’ For Stability
EKGf = filtfilt(sos,g,EKG); % Filter Signal
figure(1) % Filter Characteristic (Bode Plot)
freqz(sos, 1024, Fs);figure(2) % Examine Fidelity Of Filtered EKG Here
plot(T, EKGf)hold onplot(T, EKG)hold offgridaxis([0 2.5 ylim]) % Comment This Out To See The Entire Trace
legend('Original', 'Bandpass Filtered')title('Filtered and Unfiltered EKG')xlabel('Time (sec)')ylabel('Amplitude (mV)')[R, Rt] = findpeaks(EKGf, Fs, 'MinPeakHeight',500); % Find R-Waves & Times
figure(3) % Plot Filtered EKG
plot(T, EKGf)hold onplot(Rt, R, '^r') % Plot Identified R-Waves
hold offgridaxis([0 2.5 ylim]) % Comment This Out To See The Entire Tracelegend('EKG', 'R-Wave Peaks')title('Filtered EKG With R-Wave Locations')xlabel('Time (sec)')ylabel('Amplitude (mV)')
It is generally necessary to filter an EKG signal to remove the wandering baseline (usually due to respiratory motion) and high-frequency noise. This EKG had a bit of high-frequency noise, so I used a Butterworth bandpass filter to filter the noise and the baseline drift to get a stable baseline. I then used the findpeaks function to locate the R-waves and their times, since in this EKG it will work for that purpose. The best way to understand this code is to read the documentation on the various functions to understand what they do and how I used them here.
ABNORMAL EKG I am not certain where you got this EKG, and I am not certain what lead it is, but it is distinctly abnormal. The ST segment should be isoelectric in a healthy EKG, and there are about 2 mV of ST segment depression in this one. There is also a degree of electrical alternans in the R-wave amplitudes. The intervals and amplitudes are otherwise within normal limits. The abnormalities could be normal variants, but both need to be investigated with a full workup.
Best Answer