diff options
author | Lane Kolbly <lane.kolbly@ni.com> | 2021-04-14 14:37:10 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-04-15 14:00:34 -0500 |
commit | 1efdc3a7f6cba76cf475dbc8cc0862981981f9e0 (patch) | |
tree | a774d300c105d849efeb5dddf0592ca428bb14e3 /host/examples/rx_ascii_art_dft.cpp | |
parent | 184999c54f0f30a7952d4e8560b393730c00e353 (diff) | |
download | uhd-1efdc3a7f6cba76cf475dbc8cc0862981981f9e0.tar.gz uhd-1efdc3a7f6cba76cf475dbc8cc0862981981f9e0.tar.bz2 uhd-1efdc3a7f6cba76cf475dbc8cc0862981981f9e0.zip |
examples: Add min dynamic range limit to ascii art DFT example
The DFT plotting routine hangs when the dynamic range equals zero,
so this change adds a limit so that the dynamic range never goes
below 10.
Diffstat (limited to 'host/examples/rx_ascii_art_dft.cpp')
-rw-r--r-- | host/examples/rx_ascii_art_dft.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp index 3652522f2..12f9477a8 100644 --- a/host/examples/rx_ascii_art_dft.cpp +++ b/host/examples/rx_ascii_art_dft.cpp @@ -286,9 +286,11 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) ref_lvl -= 10; else if (ch == 'L') ref_lvl += 10; - else if (ch == 'd') - dyn_rng -= 10; - else if (ch == 'D') + else if (ch == 'd') { + if (dyn_rng > 10) { + dyn_rng -= 10; + } + } else if (ch == 'D') dyn_rng += 10; else if (ch == 's') { if (frame_rate > 1) { |