Stretch downsampled data to fit on same x axis
Afficher commentaires plus anciens
I have an array1 sampled at 2Khz for 500 seconds.
I want to visualize the hilbert transform of the data at a lower sampling rate (i.e. smoother trend)
To accomplish this I used array2 = downsample(array1, 4) then performed the hilbert transform.
As a result, array2 is shorter than array1 even though they represent the same amount of time.
How can I now "stretch" array2 back to the length of array1 so that I can view them on a plot simultaneously with the same time axis?
Fs = 2000
t = 500
>> ar1 = 1:1:Fs*t;
>> ar2 = downsample(x,4);
>> length(ar1)
ans =
1000000
>> length(ar2)
ans =
250000
>> ar2 = hilbert(ar2);
% Now how to plot ar1 and transformed ar2 on same time x axis?
Two ideas I had were: repelem, which would just make any given array2 value repeat x number of times, or upsample(), but this introduces 0's into the array. I'd rather have a smooth line if possible. Thank you!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multirate Signal Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!