Search code examples
matlabfftoctavenoisenoise-generator

making pink noise (1/f) using list of frequencies


making pink noise (1/f) using list of frequencies

I would like to see what type of noise I would get if I used just the frequency in my voice. I created a matlab/octave array using fft to get the [frequency,amplitude,phase] to reproduce my vocal signal.

I would like to take this file/data and use it to create pink noise (1/f). Of course when I use 1/f for the frequency the numbers become very small does anyone have any ideas how to use my own vocal frequencies that I get from doing a fft in matlab to create pink noise (1/f).

Thanks


Solution

  • This might do the trick: compute the mean power in your spectrum from the amplitude A = A(f), where f is the frequency.

    P = mean(A.^2);
    

    Spread that over your frequency range:

    N = length(f);
    invfnorm = 1./[1:N];
    Anew = sqrt(P*invfnorm/sum(invfnorm));
    

    Anew has the property of having the same total power density as the original spectrum, and power decaying as 1/f.

    Substitute Anew for A and inverse FFT your new spectrum to generate the new waveform.