Skip to main content
added 532 characters in body
Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

It's a matter of what we want to use for the unit of frequency. The result returned by the Welch function was a power density in units of $W/Hz$ (or more likely a power ratio or any other unit of power besides $W$). Specifically it is a a power spectral density as some unit of power over a 1 Hz bandwidth. This was set by the parameter 1/Ts that was passed into the function assuming Ts is in units of seconds. So in this case the code was created to instead plot the resulting power spectral density as power over a unit bandwidth in units of radians/sample.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

An example where such a translation would be useful in this case is if we had a filter or region of spectrum that was given in units of radians per sample, where the entire bandwidth is given as $B$. Then from the power spectral density mapped to the same frequency units as $S(f)$, we can easily compute the total power in that bandwidth as $S(f) B$ (assuming $S(f)$ is constant over $B$ otherwise this would involve an integral over $B$ or piecewise approximation).

Below is a summary of the most common units used for representing the frequency domain. This is to show all the different units side by side, but keep in mind the units in this question have to do with the vertical axis, not a horizontal axis (such as dB/Hz which is dB/(cycles/sec) converted to dB/(radians/sample). The units on the two axis are independent for a power spectral density, but it would be typical and convenient to use the same units for each (as an example depicting at a 10 KHz center frequency, the power spectral density is -30 dBm/Hz which is 1 uW/Hz). That said to describe what I depict below:

The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

Like what you see? This plot and similar explanations are part of my DSP courses where I try to bring intuition together with the math involved for a deeper and more creative understanding of signal processing concepts. You can find the latest course listings at https://dsprelated.com/courses and https://ieeeboston.org/courses/ Course registration is open now for courses starting very soon!

It's a matter of what we want to use for the unit of frequency. The result returned by the Welch function was a power density in units of $W/Hz$ (or more likely a power ratio or any other unit of power besides $W$). Specifically it is a a power spectral density as some unit of power over a 1 Hz bandwidth. This was set by the parameter 1/Ts that was passed into the function assuming Ts is in units of seconds. So in this case the code was created to instead plot the resulting power spectral density as power over a unit bandwidth in units of radians/sample.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

An example where such a translation would be useful in this case is if we had a filter or region of spectrum that was given in units of radians per sample, where the entire bandwidth is given as $B$. Then from the power spectral density mapped to the same frequency units as $S(f)$, we can easily compute the total power in that bandwidth as $S(f) B$ (assuming $S(f)$ is constant over $B$ otherwise this would involve an integral over $B$ or piecewise approximation).

Below is a summary of the most common units used for representing the frequency domain. The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

It's a matter of what we want to use for the unit of frequency. The result returned by the Welch function was a power density in units of $W/Hz$ (or more likely a power ratio or any other unit of power besides $W$). Specifically it is a a power spectral density as some unit of power over a 1 Hz bandwidth. This was set by the parameter 1/Ts that was passed into the function assuming Ts is in units of seconds. So in this case the code was created to instead plot the resulting power spectral density as power over a unit bandwidth in units of radians/sample.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

An example where such a translation would be useful in this case is if we had a filter or region of spectrum that was given in units of radians per sample, where the entire bandwidth is given as $B$. Then from the power spectral density mapped to the same frequency units as $S(f)$, we can easily compute the total power in that bandwidth as $S(f) B$ (assuming $S(f)$ is constant over $B$ otherwise this would involve an integral over $B$ or piecewise approximation).

Below is a summary of the most common units used for representing the frequency domain. This is to show all the different units side by side, but keep in mind the units in this question have to do with the vertical axis, not a horizontal axis (such as dB/Hz which is dB/(cycles/sec) converted to dB/(radians/sample). The units on the two axis are independent for a power spectral density, but it would be typical and convenient to use the same units for each (as an example depicting at a 10 KHz center frequency, the power spectral density is -30 dBm/Hz which is 1 uW/Hz). That said to describe what I depict below:

The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

Like what you see? This plot and similar explanations are part of my DSP courses where I try to bring intuition together with the math involved for a deeper and more creative understanding of signal processing concepts. You can find the latest course listings at https://dsprelated.com/courses and https://ieeeboston.org/courses/ Course registration is open now for courses starting very soon!

added 892 characters in body
Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

It's a matter of what we want onto use for the horizontal axisunit of frequency. The result returned by the Welch function was a power density in units of $W/Hz$ (or more likely a power ratio or any other unit of power besides $W$). Specifically it is a a power spectral density as some unit of power over a 1 Hz bandwidth. This was set by the parameter 1/Ts that was passed into the function assuming Ts is in units of seconds. So in this case the code was created to representinstead plot the resulting power spectral density as power over a unit bandwidth in units of frequencyradians/sample.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

An example where such a translation would be useful in this case is if we had a filter or region of spectrum that was given in units of radians per sample, where the entire bandwidth is given as $B$. Then from the power spectral density mapped to the same frequency units as $S(f)$, we can easily compute the total power in that bandwidth as $S(f) B$ (assuming $S(f)$ is constant over $B$ otherwise this would involve an integral over $B$ or piecewise approximation).

Below is a summary of the most common units used for representing the frequency domain. The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

It's a matter of what we want on the horizontal axis to represent the units of frequency.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

Below is a summary of the most common units used for representing the frequency domain. The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

It's a matter of what we want to use for the unit of frequency. The result returned by the Welch function was a power density in units of $W/Hz$ (or more likely a power ratio or any other unit of power besides $W$). Specifically it is a a power spectral density as some unit of power over a 1 Hz bandwidth. This was set by the parameter 1/Ts that was passed into the function assuming Ts is in units of seconds. So in this case the code was created to instead plot the resulting power spectral density as power over a unit bandwidth in units of radians/sample.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

An example where such a translation would be useful in this case is if we had a filter or region of spectrum that was given in units of radians per sample, where the entire bandwidth is given as $B$. Then from the power spectral density mapped to the same frequency units as $S(f)$, we can easily compute the total power in that bandwidth as $S(f) B$ (assuming $S(f)$ is constant over $B$ otherwise this would involve an integral over $B$ or piecewise approximation).

Below is a summary of the most common units used for representing the frequency domain. The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

added 892 characters in body
Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

It's a matter of what we want on the horizontal axis to represent the units of frequency.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

Below is a summary of the most common units used for representing the frequency domain. The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

It's a matter of what we want on the horizontal axis to represent the units of frequency.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

frequency axis

It's a matter of what we want on the horizontal axis to represent the units of frequency.

'(2 * pi / Fs)' converts units of Hz to normalized frequency in units of radians/sample. We often see this choice of units for frequency in digital signal processing and with it the DSP implementation can scale directly with the sampling rate (if we have a half-band filter for example, if we run it at twice the rate, it will still be a half-band filter).

Below is a summary of the most common units used for representing the frequency domain. The top one is cycles/sec or Hz. If we scale that by the sampling rate, we get normalized frequency in cycles/sample. Notice how we have simply used a time index of samples instead of seconds. Also observe how the inverse of the sampling rate in Hz is seconds/sample (how much time for each sample). Thus if we divide Hz by the sampling rate we get (cycles/sec)/(sec/sample) which is cycles/sample. We convert frequency in Hz to radian frequency by multiplying by $2\pi$ so similarly we can multiply normalized frequency in cycles/sample by $2\pi$ to get normalized frequency in radians/sample. Finally, as commonly used with the DFT, we can have a frequency index on $N$ samples typically abbreviated as $k$ with an index from $0$ to $N-1$. $N$ in this case would correspond to the sampling rate.

frequency axis

Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143
Loading