How to generate 1 cycle of a ppg signal repeatedly?

3 次查看(过去 30 天)
I want to repeat this signal periodically

采纳的回答

Bhavana Ravirala
Bhavana Ravirala 2023-2-15
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!!

更多回答(1 个)

John D'Errico
John D'Errico 2023-2-15
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.

类别

Help CenterFile Exchange 中查找有关 Parametric Spectral Estimation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by