Colored Noise: Set Duration

조회 수: 2 (최근 30일)
Nycholas Maia
Nycholas Maia 2017년 12월 31일
편집: Tanmoy Sil 2023년 2월 15일
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)

채택된 답변

Nycholas Maia
Nycholas Maia 2018년 1월 4일
I was wrong. The 'SamplesPerFrame' parameter is the length of the signal. Sorry...
  댓글 수: 1
Tanmoy Sil
Tanmoy Sil 2023년 2월 15일
편집: Tanmoy Sil 2023년 2월 15일
hello did you figure out how to set the sampling rate? its very confusing with the matlab parameters. i want to fs to be 250 hz and have 20s of desired output.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by