Removing spikes from signal

2 ビュー (過去 30 日間)
Hasan shovon
Hasan shovon 2018 年 4 月 12 日
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 件)

カテゴリ

Help Center および File ExchangeElectrophysiology についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by