Derive minimum phase from magnitude With the desired magnitude of a transfer function in the frequency domain in C++ as described below what is the correct corresponding minimum phase?  In general how does one derive the correct minimum phase in the frequency domain if the desired magnitude is known, specifically such that the a complex IFFT of it would return an entirely real part.

// PnCutoff.cpp : Pink noise above a cutoff.
#include &lt;tchar.h&gt;
#include &lt;math.h&gt;
#include &lt;conio.h&gt;

class PnAtFilter
{
    double _fcHz;
    public:
    PnAtFilter(double fcHz) { _fcHz = fcHz; }
    double Mag(double fHz)
    {
        if(fHz &lt; _fcHz) return 1.0;
        else return  1.0 / sqrt(fHz/_fcHz);
    }
    double Phase(double fHz)
    {
        return 0.0; // what is the the correct minimum phase in r?
    }
};

int _tmain(int argc, _TCHAR* argv[])
{
    PnAtFilter* pnf = new PnAtFilter(1000);
    for(int fHz = 10; fHz &lt;= 100000; fHz *= 10)
    {
        double mag = pnf-&gt;Mag(fHz); 
        double phase = pnf-&gt;Phase(fHz);
        _cprintf_s("%d Mag=%f, Phase=%f\r\n", fHz, mag, phase);
    }
    _getch();
    return 0;
}

/* output:
10 Mag=1.000000, Phase=0.000000
100 Mag=1.000000, Phase=0.000000
1000 Mag=1.000000, Phase=0.000000
10000 Mag=0.316228, Phase=0.000000
100000 Mag=0.100000, Phase=0.000000
*/
Check out Julius O. Smith III's write up.

There is a Hilbert transform relationship between the magnitude response, $G(\omega)$, and the phase response, $\theta(\omega),$ of the associated minimum phase filter.

If  

$$
H(\omega) = G(\omega) \exp(\jmath \theta(\omega))
$$
then
$$
\ln( H(\omega) ) = \ln(G(\omega)) + j\theta(\omega)
$$ 
and
$$
\theta(\omega) = - {\cal H}\left[ \ln(G(\omega)) \right]
$$
where ${\cal H}$ is the Hilbert transform.

Also check out Wikipedia's write up.