Hello I have an EEG dataset loaded into Matlab in Excel format. I want to add a random white noise to the dataset. And I need to convert the output noisy plot again into an excel file. I have attached the Matlab file.
Please suggest me
Thanks

2 件のコメント

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 11 月 12 日
You already managed to add noise. So you just want to know how to write the output to an Excel file?
dark lion
dark lion 2017 年 11 月 12 日
Nope I am not getting the output of the noisy signal It is showing an error.

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

 採用された回答

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 11 月 12 日

0 投票

I assume you're getting an error in this line:
X = dataset + 2*randn(size(t));
because dataset is an N x 2 array, whereas 2*randn(size(t)) is 1 x N. Also, you don't want to add noise to time. You need to change it to:
X = [time voltage + A*randn(length(t),1)];
A is the variance of noise, you can set A=1 if you wish. Then write to xls using:
xlswrite('noisyEEG.xls',X);
And if you want to plot it:
plot(X(:,1), X(:,2));

4 件のコメント

dark lion
dark lion 2017 年 11 月 12 日
Still I am unable to get the plot,
It is showing an error like this Matrix dimensions must agree. Error in EEGnoise (line 8) X = [time voltage + 1*randn(length(t),1)];
i will give you the input excel sheet to get a better idea. I have uploaded the text file since excel the comments section is not accepting excel format
Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 11 月 12 日
The actual length of the signal is a lot longer than the number you use (L=150). Why do you even need the sampling frequency for this? Just do:
dataset=xlsread('input signal.xlsx','sheet1','A1:B770');
t = dataset(:,1);
V = dataset(:,2);
X = [t V+1*randn(length(V),1)];
xlswrite('noisyEEG.xls',X);
plot(X(:,1), X(:,2));
dark lion
dark lion 2017 年 11 月 12 日
thank you very much for your Help the data which i have provided you is a raw EEG data I have to add some noise to the data and give the time voltage values as an input to my circuit
Thank you very much!!!
Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 11 月 12 日
Sounds cool. Good luck!

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by