Filter löschen
Filter löschen

white gaussian noise and bandwidths

19 Ansichten (letzte 30 Tage)
Paula Penullar
Paula Penullar am 6 Okt. 2020
Beantwortet: Star Strider am 6 Okt. 2020
I'm supposed to make a white noise with a variance of 1 and a mean of 2 and another with a variance of 4 and a mean of 2. Then, plot the signal in time and frequency domain. Generate a random signal n1(t) from n(t) that has bandwidth 1Hz by passing n(t) through a low pass filter. Plot n1(t) in time and frequency domain. Repeat for a random signal n4(t) that has bandwidth 4Hz.
I have an error in the line where v=...
what is wrong and does anyone have any advice as to completeing this assignment
%signals
fs = 1e2;%sampling frequency
t = -5:1/fs:5;%time vector
n = randn(1,length(t));%random: mean 0, var 1
mu = 2;
sig = 4;
v = exp*fn(n,mu,sig);%random: mean 2, var 4
p = [ zeros(1,floor(length(t)/3)) ones(1,ceil(length(t)/3)+1) zeros(1,floor(length(t)/3)) ];
c = cos(1.5*pi.*t);
g = exp((-pi.*t.^2)/2);

Antworten (1)

Star Strider
Star Strider am 6 Okt. 2020
The problem is simply with your understanding of the randn funciton. It generates normally-distributed random values with a variance of 1 and a mean of 0. If you want to change those, multiiply or add the desired scalar quantities. So for example:
r = a*randn(1,100)+b;
generates uniformly distributed random numbers with a mean of ‘b’ and a standard deviation of ‘a’.
I’m certain you can take it from there!

Community Treasure Hunt

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

Start Hunting!

Translated by