필터 지우기
필터 지우기

sine wave and sampling

조회 수: 2 (최근 30일)
john
john 2011년 4월 4일
답변: Sulaymon Eshkabilov 2020년 9월 11일
Hello to everyone,
I want to draw a period of y=sin(x) function and take 10 samples with the same interval among them. Next, to each sample I want to add a random value of noise, which value must come from the Gaussian distribution N(0,1).Could someone help me?
Thanks in advance
  댓글 수: 1
Jan
Jan 2011년 4월 4일
What have you tried so far? Which problems did occur?

댓글을 달려면 로그인하십시오.

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020년 9월 11일
The solution of this exercise is relatively simple:
N=40; % Size of a signal: resolution of the signal with 10 might be too poor.
SNR = 10; % SNR (Signal-to-Noise Ratio) in dB
x = linspace(0,360, N);
F = zeros(size(x)); IN = F;
for ii=1:N
IN(ii)=sind(x(ii));
F(ii)=awgn(IN(ii), SNR, 'measured');
end
plot(x, IN, 'r', x, F, 'b-'), grid on

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by