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,17 +186,19 @@ void SpectrumVisualProcessor::process() {
|
|||||||
if (is_view.load()) {
|
if (is_view.load()) {
|
||||||
long freqDiff = shiftFrequency - lastShiftFrequency;
|
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 (freqDiff > 0) {
|
if (numShift < fftSizeInternal/2 && numShift) {
|
||||||
memmove(&fft_result_ma[0], &fft_result_ma[numShift], (fftSizeInternal-numShift) * sizeof(double));
|
if (freqDiff > 0) {
|
||||||
memmove(&fft_result_maa[0], &fft_result_maa[numShift], (fftSizeInternal-numShift) * sizeof(double));
|
memmove(&fft_result_ma[0], &fft_result_ma[numShift], (fftSizeInternal-numShift) * sizeof(double));
|
||||||
} else {
|
memmove(&fft_result_maa[0], &fft_result_maa[numShift], (fftSizeInternal-numShift) * sizeof(double));
|
||||||
memmove(&fft_result_ma[numShift], &fft_result_ma[0], (fftSizeInternal-numShift) * sizeof(double));
|
} else {
|
||||||
memmove(&fft_result_maa[numShift], &fft_result_maa[0], (fftSizeInternal-numShift) * sizeof(double));
|
memmove(&fft_result_ma[numShift], &fft_result_ma[0], (fftSizeInternal-numShift) * sizeof(double));
|
||||||
|
memmove(&fft_result_maa[numShift], &fft_result_maa[0], (fftSizeInternal-numShift) * sizeof(double));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ void TuningCanvas::StepTuner(ActiveState state, int exponent, bool up) {
|
|||||||
double exp = pow(10, exponent);
|
double exp = pow(10, exponent);
|
||||||
long long amount = up?exp:-exp;
|
long long amount = up?exp:-exp;
|
||||||
|
|
||||||
if (halfBand && exp == 1) {
|
if (halfBand) {
|
||||||
amount *= 2;
|
amount *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user