Gaussian Noise Error message
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Please could you look into this Gaussian Noise Simulation Error. Attached also is the error
採用された回答
Image Analyst
2022 年 11 月 24 日
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
Image Analyst
2022 年 11 月 27 日
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
