Reputation: 59
I have two .wav files containing recordings of two different hearts so with different heart rates. I would like to normalize both signals in order to fix their BPM at 60 without modifying anything else.
This is how a signal is read (same thing for the other but with 2) and what it looks like (and it's FFT) :
[y1,fs1] = audioread(heartbeat1);
N1 = length(y1);
t1 = linspace(0, N1/fs1, N1);
I made some research and found
interp1
but it doesn't seem appropriate for my program. I really have no idea of how I could do that, so if you can just give a function that I could use it could be great.
Upvotes: 0
Views: 285
Reputation: 2351
I am not sure I understood.
I think you want to compare two heart beat signals with different "principal" heart beat frequencies. So I think you can plot the two signals as function of
f / f_{beat}
where f_{beat} is the heart beat frequency of a signal. This will be an adimensional (it has no units,because 1/s / 1/s = 1) frequency and should permit you to compare signals with different heart beat frequencies because it does not distort it.
This is more or less the effect of what I propose. Note that I do not know to calculate the heart beat frequency and I just used f_{beat}=0.8 1/s. Probably you can improve that.
Signal as function of frequency:
Signal as function of the adimensional frequency:
Hope this helps somehow.
Upvotes: 1