# Detecting phase difference between two channels

4 visualizzazioni (ultimi 30 giorni)
David Jones il 3 Giu 2021
Commentato: David Jones il 10 Giu 2021
Hi
I dont have a lot of experiance using MATLAB, Can someone please show me how to detect the phase differance between my 2 signals attached, number of samples are 6000 and sample rate is 0.01
Any Help would be greatly appreciated.
Kind Regards
David
##### 16 CommentiMostra 14 commenti meno recentiNascondi 14 commenti meno recenti
Bjorn Gustavsson il 9 Giu 2021
Doesn't
phi_unwrapped = unwrap(phi);
work?
David Jones il 10 Giu 2021
Hi
Yes it does, I had never used it before, but after testing I think there is to much small phase noise to be able to use the phase.
Thanks
David

Accedi per commentare.

### Risposte (1)

Bjorn Gustavsson il 10 Giu 2021
Does something like this extract variations that are related to the breathing-pattern:
fK = hanning(1001); % Arbitrary choise of low-pass filter
fK = fK/sum(fK);
subplot(2,1,1)
plot(t,phi_u) % Raw unwrapped phase
hold on
plot(t,filtfilt(fK,1,phi_u)) % low-pass-filtered phase
subplot(2,1,2)
plot(t,phi_u-filtfilt(fK,1,phi_u)) % unwrapped phase with slow variations removed.
Since we dont know what signal to extract it is difficult to advice. My gues is that your mixing signals are too close to the breath-pattern in frequency.
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
David Jones il 10 Giu 2021
Hi Bjorn
Thanks for getting back I have attached the sample data the signals of interest are 0.1 hertz to 0.45 hertz the mixer frequency is in the Mega Hertz, I then filter in the electronics the sine and cosine as above, I have also attacted the amplitude output from Matlab, can I ask you please to take a look and le me know your thoughts
Thank you
David

Accedi per commentare.

### Categorie

Scopri di più su MATLAB in Help Center e File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by