Added cessbProcessing control. Tnx KF5N

master
boblark 1 month ago
parent 5113b5394b
commit 8fbac3562b
  1. 7
      radioCESSB_Z_transmit_F32.cpp
  2. 14
      radioCESSB_Z_transmit_F32.h
  3. 10
      radioCESSBtransmit_F32.cpp
  4. 14
      radioCESSBtransmit_F32.h

@ -122,7 +122,7 @@ void radioCESSB_Z_transmit_F32::update(void) {
workingDataQ[k] *= gainFactor;
}
// Mesaure input power and peak envelope, SSB before any CESSB processing
// Measure input power and peak envelope, SSB before any CESSB processing
for(int k=0; k<nW; k++)
{
float32_t pwrWorkingData = workingDataI[k]*workingDataI[k] + workingDataQ[k]*workingDataQ[k];
@ -147,9 +147,13 @@ void radioCESSB_Z_transmit_F32::update(void) {
// LPF with gain of 2 built into coefficients, correct for added zeros.
arm_fir_f32(&firInstInterpolate1I, workingDataI, workingDataI, nC);
arm_fir_f32(&firInstInterpolate1Q, workingDataQ, workingDataQ, nC);
// WorkingDataI and Q are now at 24 ksps and ready for clipping
// For input 48 ksps this produces 64 numbers
// Optional skip CESSB processing. Filtering & SSB generation unchanged. Thanks to Greg KF5N
if(cessbProcessing) // Not skipping
{
for(int kk=0; kk<nC; kk++)
{
float32_t power = workingDataI[kk]*workingDataI[kk] + workingDataQ[kk]*workingDataQ[kk];
@ -214,6 +218,7 @@ void radioCESSB_Z_transmit_F32::update(void) {
workingDataI[k] = delayedDataI[k] - gainCompensate*diffI[k];
workingDataQ[k] = delayedDataQ[k] - gainCompensate*diffQ[k];
}
} // end CESSB processing
// Measure average output power and peak envelope, after CESSB
// but before gainOut

@ -105,6 +105,7 @@
* such as IIR. Minimize any linear-phase filtering such as FIR.
* Such activities enhance the overshoots and defeat the purpose of CESSB.
*/
// Rev 14Oct24 Added on/off via cessbProcessing. Tnx KF5N.
#ifndef _radioCESSB_Z_transmit_f32_h
#define _radioCESSB_Z_transmit_f32_h
@ -158,6 +159,16 @@ public:
//setBlockLength(128); Always default 128
}
// A "setter" and "getter" methods. If cessbProcessing==false, CESSB processing is bypassed.
// This is intended for digital modes. Greg KF5N August 16 2024
void setProcessing(bool cessbActive) {
cessbProcessing = cessbActive;
}
bool getProcessing(void) {
return cessbProcessing;
}
// Sample rate starts at default 44.1 ksps. That will work. Filters
// are designed for 48 and 96 ksps, however. This is a *required*
// function at setup().
@ -278,7 +289,8 @@ private:
struct levelsZ levelData;
audio_block_f32_t *inputQueueArray_f32[1];
uint32_t jjj = 0; // Used for diagnostic printing
bool cessbProcessing = true; // If false, CESSB processing is bypassed.
// Greg KF5N August 16 2024
// Input/Output is at 48 or 96 ksps. Hilbert generation is at 12 ksps.
// Clipping and overshoot processing is at 24 ksps.
// Next line is to indicate that setSampleRateHz() has not executed

@ -117,7 +117,7 @@ void radioCESSBtransmit_F32::update(void) {
arm_fir_f32(&firInstWeaverQ, weaverMQ, workingDataQ, nW);
// Note: Sine wave envelope gain from blockIn->data[kk] to here is gainIn
// Mesaure input power and peak envelope, SSB before any CESSB processing
// Measure input power and peak envelope, SSB before any CESSB processing
for(int k=0; k<nW; k++)
{
float32_t pwrWorkingData = workingDataI[k]*workingDataI[k] + workingDataQ[k]*workingDataQ[k];
@ -142,10 +142,17 @@ void radioCESSBtransmit_F32::update(void) {
// LPF with gain of 2 built into coefficients, correct for zeros.
arm_fir_f32(&firInstInterpolate1I, workingDataI, workingDataI, nC);
arm_fir_f32(&firInstInterpolate1Q, workingDataQ, workingDataQ, nC);
// WorkingDataI and Q are now at 24 ksps and ready for clipping
// For input 48 ksps this produces 64 numbers
// Voltage gain from blockIn->data to here for small sine wave is 1.0
// Optional skip of CESSB processing. Filtering & SSB generation unchanged. Thanks to Greg KF5N
if(cessbProcessing) // Not skipping
{
for(int kk=0; kk<nC; kk++)
{
float32_t power = workingDataI[kk]*workingDataI[kk] + workingDataQ[kk]*workingDataQ[kk];
@ -238,6 +245,7 @@ void radioCESSBtransmit_F32::update(void) {
workingDataI[k] = delayedDataI[k] - gainCompensate*diffI[k];
workingDataQ[k] = delayedDataQ[k] - gainCompensate*diffQ[k];
}
} // End CESSB processing
// Finally interpolate to 48 or 96 ksps. Data is in workingDataI[k]
// and is 64 samples for audio 48 ksps.

@ -39,6 +39,7 @@
* These times are for a 48 ksps rate, for which about 2667 microseconds
* are available.
*/
// Rev 14Oct24 Added on/off via cessbProcessing. Tnx KF5N.
#ifndef _radioCESSBtransmit_f32_h
#define _radioCESSBtransmit_f32_h
@ -92,6 +93,16 @@ public:
//setBlockLength(128); Always default 128
}
// A "setter" and "getter" methods. If cessbProcessing==false, CESSB processing is bypassed.
// This is intended for digital modes. Greg KF5N August 16 2024
void setProcessing(bool cessbActive) {
cessbProcessing = cessbActive;
}
bool getProcessing(void) {
return cessbProcessing;
}
// Sample rate starts at default 44.1 ksps. That will work. Filters
// are designed for 48 and 96 ksps, however. This is a *required*
// function at setup().
@ -200,7 +211,8 @@ private:
struct levels levelData;
audio_block_f32_t *inputQueueArray_f32[1];
float32_t freqW = 1350.0f; // Set here and not changed
bool cessbProcessing = true; // If false, CESSB processing is bypassed.
// Greg KF5N August 16 2024
// Input/Output is at 48 (or later 96 ksps). Weaver generation is at 12 ksps.
// Clipping and overshoot processing is at 24 ksps.
// Next line is to indicate that setSampleRateHz() has not executed

Loading…
Cancel
Save