MATLAB Answers

Colored Noise: Set Duration

6 views (last 30 days)
I would like to generate pink/white/blue/purple noise and set the duration of this signal. I'm using this code:
signal = dsp.ColoredNoise('Color','pink','SamplesPerFrame', 1024);
In my understanding, the 'SamplesPerFrame' variable does not indicate the duration of the generated signal, but rather the amount of samples used to obtain the desired spectral distribution (white, pink, etc ...).
How can I generate a pink noise using 1024 samples per frame (spectral distribution) and also have 20 seconds of audio duration?
I'm using:
duration = 20; % seconds
Fs = 44100; % Sample Rate (Hz)

  0 Comments

Sign in to comment.

Accepted Answer

Nycholas Maia
Nycholas Maia on 4 Jan 2018
I was wrong. The 'SamplesPerFrame' parameter is the length of the signal. Sorry...

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.