"Konst " <konstance1@hotmail.com> wrote in message <itlgem$ltu$1@newscl01ah.mathworks.com>...
> I have a signal which is plotted using data from rand(N,1).What is the sampling rate?Does matlab have a default sampling rate? And if so, how can I change it? In the program I calculate a variable w which is a columnvector and plot the gaussian. If I change the sampling rate how can i plot the gaussian again to compare the two results? Is it at all possible?
> Thanks in advance.
Hi Konstance,
There is no sampling rate associated with a discretetime sequence inherently.
A whitenoise vector has a theoretical power spectral density which is constant over the entire frequency interval, so it does not matter how you view randn(N,1). You can think of that process as sampled with whatever rate you wish.
Changing the sampling rate when you evaluate some function such as cos() amounts to changing the spacing between the angles you evaluate that function at.
t = 0:0.001:1;
y = cos(2*pi*250*t);
If you just want to add white noise to the above signal sampled at 1 kHz:
y = cos(2*pi*250*t)+randn(size(t));
Note that I have just used randn(size(t)) to add the white noise.
Wayne
