How to generate 1 cycle of a ppg signal repeatedly?
3 views (last 30 days)
Show older comments
I want to repeat this signal periodically
0 Comments
Accepted Answer
Bhavana Ravirala
on 15 Feb 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!!
More Answers (1)
John D'Errico
on 15 Feb 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.
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!