How do I find the phase response of a filter from the filter equation? I am new to this forum. I have been teaching myself DSP for the last two years, so my experience and knowledge has a long way to go.

I am trying to find the phase response of a specific filter that I am using on Csound for any given fundamental frequency of the input (and I guess I'll need to be able to do that for any cuttoff frequency and ideally any sampling rate as well).

The filter is a 1st order lowpass IIR, and the filter's equation is as follows:

$$y[n] = c_1  x[n] + c_2 y[n-1]$$


$h_p$ - half power point
$b = 2 - \cos(2 \pi h_p/s_r)$
$c_2 = b - \sqrt{b^2 - 1}$
$c_1 = 1 - c_2$


Three questions:


Can I find the phase response for any frequency based on this equation alone? 
Can I derive a phase response equation from this equation alone?
Is there a standardised way of finding the phase response for any lowpass filter, or does it depend on what kind of filter it is?


I have found some info about finding phase response both in these forums and elsewhere online, but without knowing the answer to question 3, it's hard to know if they are relevant or not.

I have also read most of the scientists and engineers guide to DSP (which I notice is also the boards DSP guide, awesome!), and I have been going back over it the last few days to try and get some clues. The best solution I can find is to fft the impulse response, and I know how to find the impulse response for a cuttoff frequency, but it'll take a long time to calculate the impulse response for all possible cuttoff frequencies.

EDIT:

I have been reexamining ths online resouce from analog.com:

http://www.analog.com/library/analogDialogue/archives/43-09/active_filters.html

The website tells me this about the phase response of a 1 pole lowpass filter:



Is this true of any 1st order low pass filter, or are they refering to a specific filter type? If this is true of my filter, I think I might be able to do this (though I won't say for sure yet!)
You need to determine the frequency response of the filter. The phase of this complex function is the filter's phase response. If you have the filter's difference equation, you need to transform it to the $\mathcal{Z}$-transform domain, where a delay of $k$ (with integer $k$) corresponds to a multiplication by $z^{-k}$:

$$Y(z)=c_1X(z)+c_2Y(z)z^{-1}\tag{1}$$

From $(1)$ you can determine the transfer function

$$H(z)=\frac{Y(z)}{X(z)}=\frac{c_1}{1-c_2z^{-1}}\tag{2}$$

The frequency response is the transfer function evaluated at $z=e^{j\omega}$, where $\omega$ is the normalized frequency in radians:

$$\omega=\frac{2\pi f}{f_s}\tag{3}$$

with $f_s$ the sampling frequency, and $f$ the actual frequency in Hz.

From $(2)$, the filter's frequency response is

$$H(e^{j\omega})=\frac{c_1}{1-c_2e^{-j\omega}}=|H(e^{j\omega})|e^{j\phi(\omega)}\tag{3}$$

where the phase response $\phi(\omega)$ is given by

$$\phi(\omega)=\text{atan2}\left(\frac{-c_2\sin(\omega)}{1-c_2\cos(\omega)}\right)\tag{4}$$

For more complicated filters it's usually easier to determine the frequency response (and the phase response) numerically by using an FFT. The (sampled) frequency response is obtained by element-wise division of the FFT of the numerator coefficients of the transfer function by the FFT of the denominator coefficients. The (sampled) phase is then obtained as the argument of this complex-valued vector. In Matlab/Octave, the frequency response can be obtained directly from the filter coefficients using the command freqz.