mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
More zoom tweaks, fix half-band tuner step
This commit is contained in:
parent
d448f6dfc4
commit
be8cde6ce3
@ -186,11 +186,12 @@ void SpectrumVisualProcessor::process() {
|
||||
if (is_view.load()) {
|
||||
long freqDiff = shiftFrequency - lastShiftFrequency;
|
||||
|
||||
double binPerHz = double(bandwidth) / double(fftSizeInternal);
|
||||
if (lastBandwidth!=0) {
|
||||
double binPerHz = double(lastBandwidth) / double(fftSizeInternal);
|
||||
|
||||
int numShift = round(double(abs(freqDiff)) / binPerHz);
|
||||
int numShift = floor(double(abs(freqDiff)) / binPerHz);
|
||||
|
||||
if (numShift < fftSizeInternal/2) {
|
||||
if (numShift < fftSizeInternal/2 && numShift) {
|
||||
if (freqDiff > 0) {
|
||||
memmove(&fft_result_ma[0], &fft_result_ma[numShift], (fftSizeInternal-numShift) * sizeof(double));
|
||||
memmove(&fft_result_maa[0], &fft_result_maa[numShift], (fftSizeInternal-numShift) * sizeof(double));
|
||||
@ -202,6 +203,7 @@ void SpectrumVisualProcessor::process() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shiftBuffer.size() != desired_input_size) {
|
||||
if (shiftBuffer.capacity() < desired_input_size) {
|
||||
|
@ -162,7 +162,7 @@ void TuningCanvas::StepTuner(ActiveState state, int exponent, bool up) {
|
||||
double exp = pow(10, exponent);
|
||||
long long amount = up?exp:-exp;
|
||||
|
||||
if (halfBand && exp == 1) {
|
||||
if (halfBand) {
|
||||
amount *= 2;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user