# Converting from radians/samples to normalized frequency range $[0.0, 1.0]$?

I'm trying to understand the following code, specifically how to use the results of scipy.signal.freqz where w in w, h = freqz(b, a, worN=8000) is in radians/samples.

I need to convert this to the range of $[0.0, 1.0]$ where $0.5$ corresponds to Nyquist frequency and $1.0$ to sample rate. And I'm trying to figure out the smartest way of doing this and whether I can use a general "any number range to any number range" algorithm or whether the radians/samples unit poses some problems regarding this?

• Also is the [0.0, 1.0] range possibly called cycles/samples? – mavavilj Aug 30 '16 at 16:19

As you noted in your comment, the normalized frequency range [0, 1) cycles/sample corresponds to the range [0, 2*pi) radians/sample. Therefore, given a frequency in the [0, 1) range, simply multiply by 2*pi to convert to radians/sample.

• So do I get from rads/samples to cycles/samples by dividing by 2*pi the rads/samples? – mavavilj Aug 30 '16 at 16:44
• Yes, that's right. – Jason R Aug 30 '16 at 17:23