Gaussian Noise Error message
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Please could you look into this Gaussian Noise Simulation Error. Attached also is the error
채택된 답변
Image Analyst
2022년 11월 24일
0 개 추천
The error seems clear. You're tying to use "signal" in a function where it does not exist. I didn't look at the code but nowhere did you either pass in "signal" or create it in the function. You need to do one or the other.
댓글 수: 7
DGM
2022년 11월 24일
I'll add
% ...
sigEner = norm(signals(:))^2; % energy of the signal
noiseEner = sigEner/(10^(reqSNR/10)); % energy of noise to be added
noiseVar = noiseEner/(length(signal(:))-1); % variance of noise to be added
St = sqrt(noiseVar); % std. deviation of noise to be added
noise = St*randn(size(signal)); % noise
noisySig = signal+noise; % noisy signal
% ...
There is a variable called signals which appears to suddenly change its name to signal
john amoo otoo
2022년 11월 27일
I tried adding s to signals to make it signals. My signals has been defined in the "Process Data" script
Replacing "signal" with "signals" in getmswtfeat fixes the signal problem but you have an index out of range error. I trust you can figure that one out, right?
%% load the data first
load('John_3PhaseFault0ohm.mat')
%% does this signal has any NaNs, if so remove
SteadyStateNoneFaultState = rmmissing(SteadyStateNoneFaultState);
Data3Phase0hmsFaultData = rmmissing(Data3Phase0hmsFaultData);
SSTime = SteadyStateNoneFaultState.Time;
SSNFS = SteadyStateNoneFaultState.SteadyStateNoneFaultState;
DPTime = Data3Phase0hmsFaultData.Time;
DPFD = Data3Phase0hmsFaultData.Data3Phase0hmsFaultData;
%% Define the filtering and inspect
n = 8; %% defines window length
w = [-ones(n,1); ones(n,1)];
SSNFS = filter(w, n, SSNFS);
DPFD = filter(w, n, DPFD);
%% Normalize signals
med_training = prctile(SSNFS,50);
iqr_training = iqr(SSNFS);
SSNFS = (SSNFS-med_training)./iqr_training;
med_fault = prctile(DPFD,50);
iqr_fault = iqr(DPFD);
DPFD = (DPFD-med_fault)./iqr_fault;
% Plot & Observe the data
subplot(2,1,1)
plot(DPTime, DPFD)
title('filtered Data3Phase0hmsFaultData')
subplot(2,1,2)
plot(SSTime, SSNFS)
title('filtered SteadyStateNoneFaultState')

%% Let's observe the FFT power spectrum for differences
feat_fault = getmswtfeat(DPFD,32,16,100000);
Index in position 2 exceeds array bounds. Index must not exceed 52.
Error in getmswtfeat (line 117)
prob = percentENER(:,st:en);%./repmat(sum(percentENER(:,st:en),2),1,longs(k)) + eps;
feat_Good = getmswtfeat(SSNFS,32,16,100000);
john amoo otoo
2022년 11월 27일
Actually the main problem figuring and fixing the index error? How do you do that?
Image Analyst
2022년 11월 27일
@john amoo otoo I'd start here:
I don't have the Wavelet Toolbox and it's not possible to debug just by running code here in Answers. So the only way is for you to learn how to debug and debug it yourself. It's a skill you will need to learn eventually anyway. "Debugging via Answers" and waiting to see if someone who has the Wavelet Toolbox is willing to do your debugging for you is very slow and not reliable. It will be much faster to do it yourself.
john amoo otoo
2022년 11월 27일
What I am trying ti get at is to de-noise the signal and extract the features with getfeat
Image Analyst
2022년 11월 27일
Yes, debugging will definitely allow you to do that. Did you learn how to debug yet from the tutorial I showed you? If not, why not?
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Denoising and Compression에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
