1 ECG signal contains 2 ECG (2 channel), what is the best way to contain atrial activities from QRS complex and ventricular activities.
7 次查看(过去 30 天)
显示 更早的评论
Im trying to write a code to detect Atrial Fribrillation using Hilbert Huang Transform.
now my sum of IMFs does not match with my original ECG signal(grey is original data red is sum of IMFs), Im suspecting that is because I didn't load the ECG data correctly into Matlab.
when I download the ECG from Physionet, it contains 2 ECG in 1 signal. as shown in figure(2ECG).the red line is QRS blue is ventricular activity. I just subtract the 2 ECG to contain Atrial Activities. however, I dont think is most accurate way to do so. i attached the Matlab figure and ECG signal, please check.
could anyone point me to the right direction? thank you!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022850/image.png)
clear all
close all
dataaf=load("AFn07m.mat"); % AF signal
xaf1=dataaf.val(1,:);
xaf2=dataaf.val(2,:);
xaf=xaf1-xaf2;
xaf=detrend(xaf)';
datan=load("normal.mat"); % Normal
xn1=datan.val(1,:);
xn2=datan.val(2,:);
xn=xn1-xn2;
xn=detrend(xn)';
xc=[xn;2*xaf];
n=5;
xc=resample(xc,n,1); %Resample ECG at n times original sampling rate
sFreq=n*128;
t = (0:length(xc)-1)/sFreq; %time value of any sample = [sample no./Fs]
plot(t,xc)
xlabel('Time [s]')
hold on
0 个评论
回答(1 个)
Shivansh
2024-2-9
Hi Dilinuier!
It appears that you are trying to analyze ECG signals to detect Atrial Fibrillation (AF) using the Hilbert-Huang Transform (HHT), and you're having issues with the reconstruction of the original signal from its Intrinsic Mode Functions (IMFs).
You are on the right path with Hilbert-Huang Transform. I think you are loading the data correctly but simple subtraction might not be the most accurate method to separate atrial activity from ventricular activity in a dual-channel ECG. You can explore advanced techniques like PCA if the atrial and ventricular activities are uncorrelated and can be separated linearly for this purpose. You can read more about PCA using Matlab here https://www.mathworks.com/help/stats/pca.html.
For the sum of IMFs part, you can ensure that the EMD part of the HHT is implemented correctly. The sum of all IMFs should reconstruct the original signal if the EMD is done correctly. you might need to adjust the stopping criteria or the shifting process if there is any error. You can refer to the following documentation to learn more about "emd" in Matlab https://www.mathworks.com/help/signal/ref/emd.html.
I hope it resolves the issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!