-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement audio sample rate selection #1034
base: master
Are you sure you want to change the base?
Implement audio sample rate selection #1034
Conversation
Could you please limit this pull request to just the audio rate selection? As I've mentioned previously, combining multiple changes into a single pull request makes it difficult to review. |
ececbfe
to
8eba911
Compare
src/applications/gqrx/receiver.cpp
Outdated
audio_snk = gr::audio::sink::make(d_audio_rate, audio_device, true); | ||
#endif | ||
|
||
make_audio_device(audio_device); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be clearer and more consistent with the rest of the code if make_audio_device
returned the device instead of internally assigning it to audio_snk
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make_audio_device
Just a bad name selection.
Renamed to create_audio_device
. I hope, this should not interfere with GNU Radio naming conventions.
This function was created to eliminate some common code and get rid of some #ifdefs
. Making it return the device would add more #ifdefs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making it return the device would add more
#ifdefs
.
I suppose it would. I guess this is fine as it is.
src/applications/gqrx/receiver.cpp
Outdated
audio_snk = gr::audio::sink::make(d_audio_rate, device, true); | ||
#endif | ||
make_audio_device(device); | ||
std::cerr<<"d_audio_rate="<<d_audio_rate<<std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this just for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I forgot to remove it.
Removed.
8eba911
to
e8773cd
Compare
I noticed a bug: the frequency axis on the audio FFT seems to be incorrect when lower audio sample rates are used. |
e8773cd
to
fd69e6e
Compare
Thanks for a review.
Confirmed. It may be fixed by setting correct sampling rate on |
This is because the demod ranges defined in gqrx/src/applications/gqrx/mainwindow.cpp Line 1157 in 7b736c4
|
It looks like this will need some careful consideration to account for all the places in the UI and DSP that are making assumptions about the audio rate. |
fd69e6e
to
a7b2540
Compare
That's just filter leakage. It can be heard at 48000Hz rate too. Setting the filter to 'sharp' reduces the peak and tone, setting the filter to 'soft' increases it. On one hand, limiting the maximum filter width (AM, SSB, CW, RAW IQ modes) to a value, that will always fit into output bandwidth is a good idea, but on the other hand, altering user settings in unexpected way may be bad. |
Ah, I think you're right. After looking closer, I see that nbrx and wfmrx have audio resamplers late in their receive chains, which should prevent aliasing. My suggestion to limit the demod ranges was based on that incorrect assumption, so I think it's fine to leave them as they are. I'll still need to do a bit more testing to make sure that there aren't any other bugs. |
I see now why I was confused by the behaviour when I expanded the filter bandwidth. The filter's transition width depends on the low & high filter cutoffs, so it becomes very large when the filter is expanded: gqrx/src/applications/gqrx/receiver.cpp Lines 678 to 705 in 7b736c4
This is surprising. I would have expected the transition width to depend only on the mode and the filter shape. |
Maybe that happens because the requested range exceeds what is possible given the current audio sample rate. There's even a FIXME about that: gqrx/src/applications/gqrx/mainwindow.cpp Line 1132 in 4eaeb16
Many other modes similarly request FFT ranges that may not be possible. |
I guess all the ranges should be capped to a maximum of half the audio rate. |
a7b2540
to
eafabd8
Compare
Thanks for suggestion. This works very well. |
eafabd8
to
9a91deb
Compare
Rebased on top of current master. I have added 88200 Hz and 96000 Hz audio rates (mostly for "RAW IQ" mode). |
9a91deb
to
dadc20b
Compare
Rebased on top of current master. |
OK. Pushing a new commit has solved the issue. |
Sorry, it looks like I caused a merge conflict when I merged #1066. I just had a quick look over this code and it's looking decent. I think I'll try to including this in the next feature release (2.16) since it's a new feature. |
9ea8065
to
e44afdc
Compare
Resolved. |
3bc3d57
to
d929c83
Compare
d929c83
to
9cb19eb
Compare
Aside from my nitpick regarding the double precision argument to the |
9cb19eb
to
53cb660
Compare
Close #615
Includes #1036, that closes #1030 and #1018.