How to make(create) a waveform in matlab as shown in the image

Hello,
I am not sure of how to create the kind of waveform shown in the image below. I found a paper in which the author says that the pulse signal is corrupted with noise(motion) and LMS adaptive filtering is used for removing this kind of noise.
1)The signal after removing motion artifacts(noise) means the pure pulse signal is shown below
2)The waveform pulse signal with noise before filtering with LMS adaptive filtering is shown below.
I want to experiment the implementation in matlab and so I need the noise waveform to be created in the matlab.
can someone explain of how to generate the pulse signal(with noise) as above.
thanks.

2 件のコメント

Gova ReDDy
Gova ReDDy 2014 年 1 月 1 日
Can someone suggest of how to generate the first signal in the attached image.
Image Analyst
Image Analyst 2014 年 1 月 1 日
編集済み: Image Analyst 2014 年 1 月 1 日
Explain what that means. Do you want to get the values by manually clicking on some chart like this? Or do you want us to recommend some kind of electronic instrument, a waveform generator, that can be used with the data acquisition toolbox to digitize the voltage? Do you want us to make some waveform like a sawtooth or sine wave or whatever, and add noise to it? After you read this again you need to rephrase your question.

サインインしてコメントする。

 採用された回答

Youssef  Khmou
Youssef Khmou 2014 年 1 月 2 日
編集済み: Youssef Khmou 2014 年 1 月 2 日

0 投票

the first signal is similar to sawtooth signal, here is how to produce the signal :
t=0:0.01:10;
y=sawtooth(2*pi*t); plot(t,y)
axis([0 10 -5 5]); grid on
%snr=10;
%x=awgn(y,snr,'measured');
%figure, plot(t,x)
SNR=10; % 10dB
sigma=std(y)*10^(-SNR/20);
x=y+sigma*randn(size(t));
figure, plot(t,x);

10 件のコメント

Gova ReDDy
Gova ReDDy 2014 年 1 月 2 日
The second part is showing error like Undefined function 'awgn' for input arguments of type 'double'.
Walter Roberson
Walter Roberson 2014 年 1 月 2 日
awgn is part of the Communications Toolbox.
Patrik Ek
Patrik Ek 2014 年 1 月 2 日
編集済み: Patrik Ek 2014 年 1 月 7 日
This could be a little too wideband disturbance maybe. You could try to create a additive white gaussian noise (AWGN) vector (which is simply a set of normally distributed numbers and with mu = 0 some standard deviation sigma). Then you run this through a lowpass filter. That should slow down the noise frequency, this can then be added to the sawtooth. Try first a cut of frequency of around 1kHz and the increase or decrease it depending on how the wave looks. This is a bit complicated, but you could try to check out FIR filtering on wikipedia.
Gova ReDDy
Gova ReDDy 2014 年 1 月 2 日
@Patrik Ek :Can I know how to implement.
Youssef  Khmou
Youssef Khmou 2014 年 1 月 2 日
i edited the code, change the SNR to see the effect .
Gova ReDDy
Gova ReDDy 2014 年 1 月 2 日
Thanks Youssef KHMOU that makes the signal simiar to first signal.
Can someone explain how to get the second signal which is the real needed one.
Youssef  Khmou
Youssef Khmou 2014 年 1 月 2 日
Gova, try with SNR=0dB. In general we can not know what type of noise is in the second figure, is it additive or multiplicative, Gaussian or uniform....
Gova ReDDy
Gova ReDDy 2014 年 1 月 5 日
編集済み: Gova ReDDy 2014 年 1 月 5 日
Is there any other alternative method to create the second signal I mean adding different combinations of high frequencies to every 1000 values of y for the image below generated with this
t=0:0.001:10;
y=sawtooth(2*pi*t);
plot(t,y)
axis([0 10 -5 5]); grid on
Youssef  Khmou
Youssef Khmou 2014 年 1 月 6 日
Gova, you have many possibilities , here are some of them :
t=0:0.001:10;
y=0;
for n=1:10
y=y+sawtooth(2*pi*n*t);
end
plot(t,y)
The second one :
f=cos(2*pi*(0:0.001:1-0.001)); % frequency of 1Hz,
f=[f f f f f f f f f f];
f(end+1)=f(end);
z=y+f;
figure, plot(t,z);
Youssef  Khmou
Youssef Khmou 2014 年 1 月 6 日
try to use also the periodic Cardinal sinus function :
plot(diric((0:0.1:100),10))

サインインしてコメントする。

その他の回答 (2 件)

Youssef  Khmou
Youssef Khmou 2014 年 1 月 6 日

0 投票

You can also create a random signal, delete of the frequencies and transform it back to temporal domain:
x=randn(200,1);
fx=fft(x);
fx(50:350)=0;
X=abs(ifft(fx));
plot(X) % approaching the second signal

5 件のコメント

Gova ReDDy
Gova ReDDy 2014 年 1 月 6 日
編集済み: Gova ReDDy 2014 年 1 月 6 日
Thanks for your different methods of creating the signals. I tried like this
x=randn(10001,1);
fx=fft(x);
fx(300:10001)=0;
X=abs(ifft(fx));
plot(X);hold on; %noise signal
t=0:0.001:10;
y=sawtooth(2*pi*t);
p=y(:,1:10001);
p1=p'+X;%addign noise to the sawtooth
plot(p1,'-r');
But is there any possibilty of creating the signal very similar to the second signal in the image as I want this for testing the Least mean square adptive filtering beacuse I tried the LMS adaptive filtering for my pulse signal coming from teh designed analog baord and was not able to filter the motion artifacts from the pulse signals ,which was also posted many times in the mathworks forum but no one was replying to it .Then I thought no one is familiar with LMS adtive filtering and want to try myself with creating artificial as shown in the first image and want to know whether LMS can work for this or not so that it can be applied for my signal coming from analog board. Thanks.
Youssef  Khmou
Youssef Khmou 2014 年 1 月 6 日
my knowledge is limited in this case, you can delete and repost the question for other users. cordially .
Gova ReDDy
Gova ReDDy 2014 年 1 月 6 日
Thankyou and I will post another one without deleting this one because others can see the different methods you have suggested so far.
Image Analyst
Image Analyst 2014 年 1 月 6 日
You "also posted many times in the mathworks forum but no one was replying to it ." might indicate that no one here knows about your topic, and that posting many times again will yield similar non-results.
Gova ReDDy
Gova ReDDy 2014 年 1 月 6 日
Yes,I do Agree with you Image Analyst but I was thinking to post about the signal generation or creation as similar to the second signal shown in the starting image of this thread and is not about the filtering method.

サインインしてコメントする。

Gova ReDDy
Gova ReDDy 2014 年 1 月 9 日
編集済み: Gova ReDDy 2014 年 1 月 9 日

0 投票

The answer can be found here

カテゴリ

ヘルプ センター および File ExchangeSignal Generation and Preprocessing についてさらに検索

製品

質問済み:

2014 年 1 月 1 日

編集済み:

2014 年 1 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by