trying to make a random number sequence similar to an MLS sequence

I'm trying to create a random number sequence like this one: -
x = 2*rand(N,1)-1; % generate input noise signal
except instead of the numbers being at all different values between -1 and 1, I'd like them to be either -1 or 1 only.
Does anyone know how I might do this?

2 Kommentare

This is nothing like an MLS sequence. What you are looking for is often called Bernoulli noise.
Tom's question
I'm trying to create a random number sequence like this one: -
x = 2*rand(N,1)-1; % generate input noise signal
except instead of the numbers being at all different values between -1 and 1, I'd like them to be either -1 or 1 only.
Does anyone know how I might do this?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Weitere Antworten (0)

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by