kopia lustrzana https://github.com/sh123/codec2_talkie
Workaround for 300 bps receive
rodzic
fa25b0e953
commit
b4f985c5f2
|
@ -143,7 +143,6 @@ public class Aprs implements Protocol {
|
||||||
if (data.length == 0) return;
|
if (data.length == 0) return;
|
||||||
AprsDataType dataType = new AprsDataType((char)data[0]);
|
AprsDataType dataType = new AprsDataType((char)data[0]);
|
||||||
AprsData aprsData = AprsDataFactory.fromBinary(src, dst, data);
|
AprsData aprsData = AprsDataFactory.fromBinary(src, dst, data);
|
||||||
Log.i(TAG, "onReceiveData() " + aprsData.isValid() + " " + dataType.getDataType() + " " + src + " " + dst);
|
|
||||||
if (aprsData != null && aprsData.isValid()) {
|
if (aprsData != null && aprsData.isValid()) {
|
||||||
if (dataType.isTextMessage()) {
|
if (dataType.isTextMessage()) {
|
||||||
TextMessage textMessage = aprsData.toTextMessage();
|
TextMessage textMessage = aprsData.toTextMessage();
|
||||||
|
|
|
@ -60,7 +60,8 @@ public class SoundModem implements Transport, Runnable {
|
||||||
String type = _sharedPreferences.getString(PreferenceKeys.PORTS_SOUND_MODEM_TYPE, "1200");
|
String type = _sharedPreferences.getString(PreferenceKeys.PORTS_SOUND_MODEM_TYPE, "1200");
|
||||||
_name = "SoundModem" + type;
|
_name = "SoundModem" + type;
|
||||||
if (type.equals("300")) {
|
if (type.equals("300")) {
|
||||||
_fskModem = Codec2.fskCreate(SAMPLE_RATE, 300, 1600, 200);
|
// XXX, use 230 tone spacing, <230 spacing for 300 bps does not work with codec2 fsk for receive
|
||||||
|
_fskModem = Codec2.fskCreate(SAMPLE_RATE, 300, 1600, disableRx ? 200 : 230);
|
||||||
} else {
|
} else {
|
||||||
_fskModem = Codec2.fskCreate(SAMPLE_RATE, 1200, 1200, 1000);
|
_fskModem = Codec2.fskCreate(SAMPLE_RATE, 1200, 1200, 1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -487,7 +487,7 @@ void fsk_demod_freq_est(struct FSK *fsk, COMP fsk_in[], float *freqs, int M) {
|
||||||
#ifdef USE_HANN_TABLE
|
#ifdef USE_HANN_TABLE
|
||||||
hann = fsk->hann_table[i];
|
hann = fsk->hann_table[i];
|
||||||
#else
|
#else
|
||||||
hann = 0.5 - 0.5 * cosf(2.0 * M_PI * (float)i / (float) (fft_samps-1));
|
hann = 0.5 - 0.5 * cosf(2.0 * M_PI * (float)i / (float) (Ndft-1));
|
||||||
#endif
|
#endif
|
||||||
fftin[i].r = hann*fsk_in[i+a].real;
|
fftin[i].r = hann*fsk_in[i+a].real;
|
||||||
fftin[i].i = hann*fsk_in[i+a].imag;
|
fftin[i].i = hann*fsk_in[i+a].imag;
|
||||||
|
|
Ładowanie…
Reference in New Issue