Producing Colored Noise from a given PSD Data I need to estimate (extract/produce) the colored noise of a given PSD Data. I have the following procedure to get the desired results.


First of all I calculate the filter coefficiencts using firls command in MATLAB by implementing Helbert Transform firls(filter_order,norm_freq,signal,'hilbert'), the problem I face is to choose the right order for the filter, I am at the moment working with hit and trial method and rougly a value of around 400 is selected which fits quite well with the PSD curve.
Secondly the white noise is passed to this filter and further amplified with a power amp. PSD of the extracted noise is again calculted and matched with the input PSD.


I want to know if this way is alright or not, moreover for passing white noise through the filter I am using Simulink, is there a way not to use time varibales and directly calculate the colored noise. In other word if I have to get rid of Simulink block. I tried to work with lsim and I can get to colored noise but it's amplitude is lesser and I am not sure how can I amplify the output signal so that it matches the input PSD.

just a short flow:

INPUT PSD --> Filter Coefficient Calculated --> White Noise Passed Through Filter --> Colored Noise at a lower amplitude extracted --> Amplified --> PSD of Colored Noise Calculated --> INPUT PSD matched with OUTPUT PSD
Estimating the necessary filter order
There are methods for estimating the needed filter order for low/band/high-pass filters, but the fact that you are talking about &quot;colored noise&quot; suggests that you are not going for relatively simple frequency profiles.  Thus, the answer is &quot;no&quot;, I am not aware of an order estimator that will help you.  The best generic advice I can give you is to go as high as you can stand performance-wise and hopefully that will be enough.

Filtered/Colored output has lower amplitude than input
It sounds like you know the frequency profile you want, and are creating a filter that produces that profile.  If that is the case, fixing this should be easy.  Do the following:

Calculate the average of the amplitude of the frequency profile you are creating.
Divide all of your filter coefficients by that average.



That should make the overall gain of the filter &quot;1&quot; with regards to white noise input.