mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 23:09:26 -05:00
Finalise all low bit rate Capture App with x64 (#1386)
* Finalise all low bit rate Capture App with x64 * Adding back also 25k BW option
This commit is contained in:
parent
bd2ee03e44
commit
a4636d7872
@ -77,6 +77,7 @@ options_t freqman_bandwidths[4] = {
|
|||||||
{"12k5", 12500},
|
{"12k5", 12500},
|
||||||
{"16k", 16000},
|
{"16k", 16000},
|
||||||
{"25k", 25000},
|
{"25k", 25000},
|
||||||
|
{"32k", 32000},
|
||||||
{"50k", 50000},
|
{"50k", 50000},
|
||||||
{"75k", 75000},
|
{"75k", 75000},
|
||||||
{"100k", 100000},
|
{"100k", 100000},
|
||||||
|
@ -113,8 +113,7 @@ uint32_t RecordView::set_sampling_rate(uint32_t new_sampling_rate) {
|
|||||||
* They are ok as recorded spectrum indication, but they should not be used by Replay app. (the voice speed will be accelerated)
|
* They are ok as recorded spectrum indication, but they should not be used by Replay app. (the voice speed will be accelerated)
|
||||||
|
|
||||||
* We keep original black background in all the correct IQ .C16 files BW's Options. */
|
* We keep original black background in all the correct IQ .C16 files BW's Options. */
|
||||||
if ((actual_sampling_rate > 8'000'000) || ((actual_sampling_rate <= 1'600'000) && (oversample_rate > OversampleRate::x8))) { // yellow REC button means not ok for REC, BW >1Mhz , BW <= 100khz due to NG aliasing.
|
if (actual_sampling_rate > 8'000'000) { // yellow REC button means not ok for REC, BW >1Mhz (BW from 12k5 till 1Mhz OK for REC and Replay)
|
||||||
// to be updated or removed in the next PR's, according the achieved extended BW's with good quality bandwith REC limits .
|
|
||||||
button_record.set_background(ui::Color::yellow());
|
button_record.set_background(ui::Color::yellow());
|
||||||
} else {
|
} else {
|
||||||
button_record.set_background(ui::Color::black());
|
button_record.set_background(ui::Color::black());
|
||||||
@ -145,11 +144,11 @@ OversampleRate RecordView::get_oversample_rate(uint32_t sample_rate) {
|
|||||||
|
|
||||||
auto rate = ::get_oversample_rate(sample_rate);
|
auto rate = ::get_oversample_rate(sample_rate);
|
||||||
|
|
||||||
// Currently proc_capture only supports x8, x16, x32 for decimation.
|
// Currently proc_capture only supports /8, /16, /32 for decimation.
|
||||||
if (rate < OversampleRate::x8) // clipping while x4 is not implemented yet.
|
if (rate < OversampleRate::x8) // clipping while /4 is not implemented yet (it will be used >1Mhz onwards when available)
|
||||||
rate = OversampleRate::x8;
|
rate = OversampleRate::x8;
|
||||||
else if (rate > OversampleRate::x32) // clipping while x64 is not implemented yet .
|
else if (rate > OversampleRate::x64) // clipping while /128 is not implemented yet , (but it is not necessary for 12k5)
|
||||||
rate = OversampleRate::x32;
|
rate = OversampleRate::x64;
|
||||||
|
|
||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,11 @@ void CaptureProcessor::sample_rate_config(const SampleRateConfigMessage& message
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OversampleRate::x32:
|
case OversampleRate::x32:
|
||||||
decim_1_factor = 2 * decim_1_8.decimation_factor; // /x32 = /4x8 (we applied additional *2 correction to speed up waterfall, no effect to scale spectrum)
|
decim_1_factor = 2 * decim_1_8.decimation_factor; // /32 = /4x8 (we applied additional *2 correction to speed up waterfall, no effect to scale spectrum)
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OversampleRate::x64:
|
||||||
|
decim_1_factor = 8 * decim_1_8.decimation_factor; // /64 = /8x8 (we applied additional *8 correction to speed up waterfall, no effect to scale spectrum)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -167,6 +171,9 @@ buffer_c16_t CaptureProcessor::decim_0_execute(const buffer_c8_t& src, const buf
|
|||||||
case OversampleRate::x32:
|
case OversampleRate::x32:
|
||||||
return decim_0_4.execute(src, dst); // decim_0 , /4 with double decim stage
|
return decim_0_4.execute(src, dst); // decim_0 , /4 with double decim stage
|
||||||
|
|
||||||
|
case OversampleRate::x64:
|
||||||
|
return decim_0_8.execute(src, dst); // decim_0 , /8 with double decim stage
|
||||||
|
|
||||||
default:
|
default:
|
||||||
chDbgPanic("Unhandled OversampleRate");
|
chDbgPanic("Unhandled OversampleRate");
|
||||||
return {};
|
return {};
|
||||||
@ -183,10 +190,13 @@ buffer_c16_t CaptureProcessor::decim_1_execute(const buffer_c16_t& src, const bu
|
|||||||
}
|
}
|
||||||
|
|
||||||
case OversampleRate::x16:
|
case OversampleRate::x16:
|
||||||
return decim_1_2.execute(src, dst); // total decim /16 = /8x2, applied to 150khz
|
return decim_1_2.execute(src, dst); // total decim /16 = /8x2, applied to 100khz and 150khz
|
||||||
|
|
||||||
case OversampleRate::x32:
|
case OversampleRate::x32:
|
||||||
return decim_1_8.execute(src, dst); // total decim /32 = /4x8, appled to <= 100khz , 75k with margin ,(50k, 25k, 12k5 now also) ...
|
return decim_1_8.execute(src, dst); // total decim /32 = /4x8, appled to 75k , 50k, 32k
|
||||||
|
|
||||||
|
case OversampleRate::x64:
|
||||||
|
return decim_1_8.execute(src, dst); // total decim /64 = /8x8, appled to 16k and 12k5
|
||||||
|
|
||||||
default:
|
default:
|
||||||
chDbgPanic("Unhandled OversampleRate");
|
chDbgPanic("Unhandled OversampleRate");
|
||||||
|
@ -57,10 +57,9 @@
|
|||||||
* The oversample rate is used to increase the sample rate to improve SNR and quality.
|
* The oversample rate is used to increase the sample rate to improve SNR and quality.
|
||||||
* This is also used as the interpolation rate when replaying captures. */
|
* This is also used as the interpolation rate when replaying captures. */
|
||||||
inline OversampleRate get_oversample_rate(uint32_t sample_rate) {
|
inline OversampleRate get_oversample_rate(uint32_t sample_rate) {
|
||||||
if (sample_rate < 50'000) return OversampleRate::x128; // 25k..12k5, prepared for future, OVS ok, but decim. x128 still not implemented.
|
if (sample_rate < 30'000) return OversampleRate::x64; // 25k, 16k, 12k5.
|
||||||
if (sample_rate < 100'000) return OversampleRate::x64; // 50k, prepared for future, OVS ok, but decim. x64 still not implemented.
|
if (sample_rate < 80'000) return OversampleRate::x32; // 75k, 50k, 32k.
|
||||||
if (sample_rate < 150'000) return OversampleRate::x32; // 100k needs x32
|
if (sample_rate < 250'000) return OversampleRate::x16; // 100k and 150k.
|
||||||
if (sample_rate < 250'000) return OversampleRate::x16; // 150k needs x16
|
|
||||||
|
|
||||||
return OversampleRate::x8; // 250k .. 1Mhz, that decim x8 , is already applied.(OVerSampling and decim OK)
|
return OversampleRate::x8; // 250k .. 1Mhz, that decim x8 , is already applied.(OVerSampling and decim OK)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user