How to generate 1 cycle of a ppg signal repeatedly?

3 ビュー (過去 30 日間)
Anupama V
Anupama V 2023 年 2 月 15 日
コメント済み: Anupama V 2023 年 2 月 15 日
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 Center および File ExchangeParametric Spectral Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by