필터 지우기
필터 지우기

Generating an example noisy sine wave signal

조회 수: 22 (최근 30일)
Chuki Ocheje
Chuki Ocheje 2023년 9월 15일
답변: Star Strider 2023년 9월 15일
I want to generate a noisy sine wave signal with fs = 16000Hz and performs sampling over the time period from 0 secs to 0.02 secs, for 321 samples in total .
fs = 16000; % sampling frequency
t = 0:1/fs:0.02; % start : time step : end
s1 = 1.00 * sin(2*pi*150 * t); % desired 150 Hz sine wave
s2 = 0.05 * sin(2*pi*3304 * t); % interfering noise (3304 Hz)
s3 = 0.02 * sin(2*pi*4000 * t); % more interfering noise (4000 Hz)
s4 = 0.04 * sin(2*pi*5722 * t); % more interfering noise (5722 Hz)
s5 = 0.07 * sin(2*pi*7302 * t); % more interfering noise (7302 Hz)
sigsum = s1 + s2 + s3 + s4 + s5; % final superposed noisy signal
I also want to use the plot command below to verifymy answer:
plot(t, sigsum)

답변 (1개)

Star Strider
Star Strider 2023년 9월 15일
Try this —
fs = 16000; % sampling frequency
t = 0:1/fs:0.02; % start : time step : end
sigsum = sum([1; 0.05; 0.02; 0.04; 0.07].*sin(2*pi*[150; 3304; 4000; 5722; 7320]*t));
figure
plot(t, sigsum)
grid
xlabel('t')
ylabel('s')
.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by