Removing spikes from signal
2 ビュー (過去 30 日間)
古いコメントを表示
Consider the open-loop voltage across the input of an analog instrument in the presence of 60 Hz power-line noise. The sample rate is 1 kHz.
load openloop60hertz
%%code
load openloop60hertz;
fs = 1000;
t = (0:numel(openLoopVoltage) - 1)/fs;
% % Corrupt the signal by adding transients with random signs at random points. Reset the random number generator for reproducibility.
% code
rng default
spikeSignal = zeros(size(openLoopVoltage));
spks = 10:100:1990;
spikeSignal(spks+round(2*randn(size(spks)))) = sign(randn(size(spks)));
noisyLoopVoltage = openLoopVoltage + spikeSignal;
plot(t,noisyLoopVoltage)
xlabel('Time (s)')
ylabel('Voltage (V)')
title('Open-Loop Voltage with Added Spikes')
i have not understand why spikeSignal(spks+round(2*randn(size(spks)))) = sign(randn(size(spks))); is used ??
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Electrophysiology についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!