How to generate 1 cycle of a ppg signal repeatedly?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Anupama V
le 15 Fév 2023
Commenté : Anupama V
le 15 Fév 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1296270/image.png)
I want to repeat this signal periodically
0 commentaires
Réponse acceptée
Bhavana Ravirala
le 15 Fév 2023
Hi Anupma!
I understand that you want to repeat the signal that you have generated. You can use ‘repmat’ function for this operation.
n_cycles = 10; % Number of cycles to generate
%ppg_cycle is the signal which you want to repeat.
ppg_signal = repmat(ppg_cycle, 1, n_cycles);
Please refer to the below documentation for more information.
Hope this helps!!
Plus de réponses (1)
John D'Errico
le 15 Fév 2023
You have a function, that is defined on what seems to be roughly the interval [0,220]. Since you have not given us any data, only a picture of that data, I'll make something up to show an example.
x = 0:220;
y = exp(-((x-110)/50).^2)*12 - 6;
plot(x,y,'-')
Now you wish to perform the periodic extrapolation of this function onto the real line.
smallspl = makima(x,y);
xdomain = [min(x),max(x)];
extrapfun = @(X) fnval(smallspl,xdomain(1)+ mod(X-xdomain(1),diff(xdomain)));
fplot(extrapfun,[-1000,1000])
So the fully periodic extrapolation of this form onto the real line. I used fnval, which presumes the curve fitting toolbox, but you could have used ppval instead. And if makima does not work for you, you could have used pchip to create the spline. Or you could have used spline.
Voir également
Catégories
En savoir plus sur Parametric Spectral Estimation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!