Fix performance issue and file-naming issue.

remotes/origin/master
guido 2019-01-28 22:25:21 +01:00 zatwierdzone przez guido
rodzic 94ef8ae2eb
commit 0a90ce8afd
2 zmienionych plików z 9 dodań i 12 usunięć

Wyświetl plik

@ -378,16 +378,6 @@ inline void vox(int8_t amp)
}
volatile uint8_t drive = 4;
void set_pwm_pa(uint8_t amp)
{
// Based on amplitude set the PA voltage through PWM. The following voltages at L4 have been measured for various PWM values: 0x00 (0.48V), 0x10 (0.50V), 0x1A (0.54V), 0x1D (0.66V), 0x20 (3.4-7V), 0x30 (6.5-11V), 0x40 (9.96V), 0x60 (11V), 0x80 (11.5V), 0xFF (11.8V)
#define KEY_OUT_PWM_MIN 0x1D // The PWM (threshold) value where the voltage over L4 just start rising ~0.6V
#define KEY_OUT_PWM_MAX 0x60 // The PWM value where the maximum voltage over L4 is approximated ~11V
if(drive == 0) // constant-carrier SSB
OCR1BL = 0xFF;
else
OCR1BL = amp / (0xFF/(KEY_OUT_PWM_MAX - KEY_OUT_PWM_MIN)) + KEY_OUT_PWM_MIN; // Set PWM amplitude at OC1B (KEY_OUT) in the working range of the PA supply (1 to 11V) --> the current implmentation is quite crude: it would be nice if we can linearize this via a calibration technique
}
#define F_SAMP 4400
#define MAX_DP 360 // the occupied SSB bandwidth can be further reduced by restricting the maximum phase change (set MAX_DP to 180).
@ -413,7 +403,14 @@ inline int16_t ssb(uint8_t in)
amp *= drive; //scale so that input amplitude is full scale; drive=4 seems a good drive
amp = (amp > 255) ? 255 : amp; // clip
set_pwm_pa(amp);
// Based on amplitude set the PA voltage through PWM. The following voltages at L4 have been measured for various PWM values: 0x00 (0.48V), 0x10 (0.50V), 0x1A (0.54V), 0x1D (0.66V), 0x20 (3.4-7V), 0x30 (6.5-11V), 0x40 (9.96V), 0x60 (11V), 0x80 (11.5V), 0xFF (11.8V)
#define KEY_OUT_PWM_MIN 0x1D // The PWM (threshold) value where the voltage over L4 just start rising ~0.6V
#define KEY_OUT_PWM_MAX 0x60 // The PWM value where the maximum voltage over L4 is approximated ~11V
if(drive == 0) // constant-carrier SSB
OCR1BL = 0xFF;
else
OCR1BL = amp / (0xFF/(KEY_OUT_PWM_MAX - KEY_OUT_PWM_MIN)) + KEY_OUT_PWM_MIN; // Set PWM amplitude at OC1B (KEY_OUT) in the working range of the PA supply (1 to 11V) --> the current implmentation is quite crude: it would be nice if we can linearize this via a calibration technique
vox(v[1]+v[6]+v[13]+v[17]+v[24]);
//i+=1; // make phasor off-center redcudes noise: may improve quality

Wyświetl plik

@ -145,7 +145,7 @@ LPF-bank/matching-network may be placed instead of the existing LPF C25-C28, L1-
[QCX-SSB]: https://github.com/threeme3/QCX-SSB
[QCX-SSB Sketch]: https://raw.githubusercontent.com/threeme3/QCX-SSB/master/qcx-ssb.ino
[QCX-SSB Sketch]: https://raw.githubusercontent.com/threeme3/QCX-SSB/master/QCX-SSB.ino
[X1M-mic]: https://vignette.wikia.nocookie.net/x1m/images/f/f1/X1M_mic_pinout_diagram.jpg/revision/latest?cb=20131028014710