I have attempted question 1 a) below in MATLAB 6.5, but I need my answer to be checked.

  • How do I do question 1 b) below ?
  • What does it mean to have a zero mean?
  1. Generate the following signals with a computer program:
    • a) Random noise in the amplitude interval (0,0 1,0)
    • b) Random noise in the previous question but with a zero mean
function [] = Question1a()
datapoint = 1000;
z= x + y;
NoiseAmplitude = 1; 
Noise = x + NoiseAmplitude*randn(size(z));
title('Noise in the Amplitude interval (0,0,1,0)')
ylabel ('Amplitude')
xlabel ('Time(s)')

enter image description here

  • $\begingroup$ Why are you adding a sinusoid to your pseudo-random sequence? $\endgroup$
    – Speedy
    Sep 23, 2016 at 9:11
  • $\begingroup$ @Speedy, I was following some examples from past questions on this site and on other sites on the web. I want to know the best way to tackle this problem. thank you. $\endgroup$
    – joe
    Sep 23, 2016 at 10:15

1 Answer 1


The phrase "zero mean" is primarily a phrase from the mathematical field of statistics. For us, a "zero mean" sequence means a sequence of numbers whose mathematical average is zero.

By the way, MATLAB's randn(1,N) command does not generate exactly a zero mean sequence. It generates an N-length sequence of random numbers that fluctuate randomly above and below an amplitude of zero, but the sequence's mean is not guaranteed to be zero. The larger is N the closer the average (mean) of randn(1,N) will be to zero. Try these:

mean(randn(1,5)) and mean(randn(1,500))

I have no idea what "the amplitude interval (0,0 1,0)" means.

  • $\begingroup$ Thanks Richard. So this means my answer is incorrect? $\endgroup$
    – joe
    Sep 23, 2016 at 4:10
  • $\begingroup$ @joe: I don't know if your solution is correct because I don't understand the original problem. Can you tell me what "in the amplitude interval (0,0 1,0)" means in English words? [In your code, it looks like you didn't need to compute the 'y' and 'z' sequences.] $\endgroup$ Sep 23, 2016 at 20:37
  • $\begingroup$ I asked my lecturer early today and he said we have to take any sinusoidal of our choice at a frequency of our choice and we have to add noise to the signal. He said the amplitude of the noise must be 1. So i think I complicated stuff and used 2 sinusoidal waves and summed them up, since I followed an example from another website were they used 2 waves. He also told us we can use "Rand" or "Randn" and for the second part of the question we use "mean". He also told us we can use another software if we not sure of MatLab or Octave. He also said we have to had him the plots on Tuesday. $\endgroup$
    – joe
    Sep 23, 2016 at 21:30
  • $\begingroup$ @joe: Our conversation here is too complicated to conduct on this web page. Send me a private e-mail and I will help you. (For me right now, it's 2:24 AM on Saturday morning.) My e-mail address is: R_dot_Lyons_at_ieee_dot_org. $\endgroup$ Sep 24, 2016 at 9:26
  • $\begingroup$ Sir, I did email you. thank you. Its 3:15 PM Saturday evening in my country. $\endgroup$
    – joe
    Sep 24, 2016 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.