Matlab Script that I can add a Gaussian Noise to a Discrete Wavelet Transform processed fault signal
1 次查看(过去 30 天)
显示 更早的评论
Please does any one has a matlab script where I can add a Gausssian Noise to a Discrete Wavelete Transform processed fault signal. This will mimic a lightning disturbance and switching disturbance during fault connditions and normal steady state. Forf the protective relay to distinguish between this lightning disturbance and fault conditions
0 个评论
采纳的回答
William Rose
2022-9-18
编辑:William Rose
2022-9-18
If you have a fault signal x(t), processed by a DWT (or not), add Gaussian noise as shown.
s=1; %standard deviation of the added noise
xn=x+s*randn(size(x)); %x=signal without added noise
The fact that the signal has been processed by a DWT is not really relevant, unless there is more information that you want to share. Good luck with your work on lightning and faults.
14 个评论
William Rose
2022-9-26
I worked around the calls to rmmissing(). Then I get the same error you reported earlier*:
Index exceeds matrix dimensions.
Error in getmswtfeat (line 115)
prob = percentENER(:,st:en);
Error in processdataWR (line 37)
feat_fault = getmswtfeat(DPFD,32,16,100000);
The error above occurs because percentENER is 43x52, but st=689. Line 115 tells Matlab to get data from columns 689 and following of a matrix which has only 52 columns. Of course this is an error.
The error occurs inside a funciton which you did not write (accfording to the documentaiton in the code). I suggest you contact the author of the function for assistance.
You call getmswtfeat twice: once on each of the fiinal two lines of your script. The comment preceding the calls is
%% Let's observe the FFT power spectrum for differences
But getmswtfeat does not return the power spectrum, so either the comment is incorrect (i.e. you are not really interesting in observing the FFT), or you are using a function that does not accomplish your goal.
You have added noise to the signals inside getmswtfeat, The signals which are analyzed and plotted in the main program are unaffected by this added noise, because 1. The noisy signals are not passed back from getmswtfeat to the main program, and 2. even if the signals were passed back, the calls to getmswtfeat are at the very end of the main program.
*The line numbers in the error message are different than what you reported, because of the work-around code which I added.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!