Sample Rate Change: Difference between revisions
Mattcarrick (talk | contribs) |
Mattcarrick (talk | contribs) |
||
Line 73: | Line 73: | ||
[[File:InterpolationFinalFlowgraph.png|700px]] | [[File:InterpolationFinalFlowgraph.png|700px]] | ||
Running the flowgraph will show the following ''QT GUI Frequency Sink'': | |||
[[File:RunInterpolationFlowgraph.png|500px]] | |||
== Decimation == | == Decimation == |
Revision as of 22:21, 12 January 2022
This tutorial describes how to implement sample rate change within GNU Radio.
The previous tutorial, Designing Filter Taps, demonstrates how to design filter taps and use them in signal processing blocks. Please complete the Designing Filter Taps tutorial before completing this one.
Interpolation
Interpolation is the process of increasing the sampling rate and thus the available bandwidth. This example will demonstrate how to increase the sampling rate using the Interpolating FIR Filter block.
Start by adding the following blocks to the flowgraph and connect them:
- Two Variable blocks
- Low-Pass Filter Taps
- QT GUI Range
- Signal Source
- Interpolating FIR Filter
- Throttle
- QT Frequency GUI Sink
Edit the first of the two new variable blocks:
- Id: interpolation_rate
- Value: 4
Edit the second of the two new variable blocks:
- Id: samp_rate_interpolated
- Value: samp_rate*interpolation_rate"
Edit the properties of the Low-Pass Filter Taps block:
- Id: lowPassTaps
- Sample Rate (Hz): samp_rate_interpolated
- Cutoff Freq (Hz): samp_rate_interpolated/(interpolation_rate*2)
- Transition Width (Hz): samp_rate_interpolated/(interpolation_rate*4)
Edit the properties of the QT GUI Range block:
- Id: frequency
- Default Value: 0
- Start: -samp_rate/2
- Stop: samp_rate/2
Edit the property of the Signal Source:
- Frequency: frequency
Edit the properties of the Interpolating FIR Filter block:
- Interpolation: interpolation_rate
- Taps: lowPassTaps
The Interpolating FIR Filter will increase the sampling rate from 32 kHz to 128 kHz, a factor of 4 due to the interpolation_rate variable. Make a note of this by editing the Comment field under the Advanced tab:
The comment is then displayed as a visual reminder in GRC:
Edit the Throttle property:
- Sample Rate: samp_rate_interpolated
Edit the QT GUI Frequency Sink property:
- Bandwidth (Hz): samp_rate_interpolated
The flowgraph should now look like the following:
Running the flowgraph will show the following QT GUI Frequency Sink:
Decimation
Rational Rate Resampling
Arbitrary Rate Resampling
- updating sample rate variable