Olivia pulse shape changes

Transmit noise floor < 55 dB; changed to 85 dB
pull/2/head
David Freese 2009-02-17 18:22:43 -06:00
rodzic 4181ca882e
commit 77d0b4ecec
2 zmienionych plików z 51 dodań i 29 usunięć

Wyświetl plik

@ -413,13 +413,21 @@ public:
// the symbol shape described in frequency domain
static const double MFSK_SymbolFreqShape[] =
// { 1.0, 1.0 } ;
{ +1.0000000000,
+1.1913785723,
-0.0793018558,
-0.2171442026,
-0.0014526076
};
{ 1.0, 1.0 } ; // use raised cosine shape - experimental
// from gMFSK
// { +1.0000000000,
// +1.1913785723,
// -0.0793018558,
// -0.2171442026,
// -0.0014526076
//};
// from DM780
//{
// +1.0000000000,
// +2.1373197349,
// +1.1207588117,
// -0.0165609232
//};
static const size_t MFSK_SymbolFreqShapeLen =
sizeof(MFSK_SymbolFreqShape) / sizeof(double);
@ -595,8 +603,12 @@ private:
void AddSymbol(int Freq, int Phase) {
size_t Time;
for (Time = 0; Time < SymbolLen; Time++) {
// Type Shape=1.0-CosineTable[Time];
OutTap[TapPtr] += CosineTable[Phase] * SymbolShape[Time];
// experimental use with {1.0, 1.0};
Type Shape=1.0-CosineTable[Time];
OutTap[TapPtr] += CosineTable[Phase] * Shape;
// OutTap[TapPtr] += CosineTable[Phase] * SymbolShape[Time];
Phase += Freq;
Phase &= WrapMask;
TapPtr += 1;

Wyświetl plik

@ -86,8 +86,13 @@ void olivia::tx_init(SoundBase *sc)
void olivia::send_preamble()
{
double freqa, freqb;
int i, sr4 = samplerate / 4;
int i, j, sr4 = samplerate / 4;
double ampshape[sr4];
for (int i = 0; i < sr4; i++) ampshape[i] = 1.0;
for (int i = 0; i < sr4 / 4; i++)
ampshape[i] = ampshape[sr4 - 1 - i] = 0.5 * (1.0 - cos(M_PI * i / (sr4/4)));
if (reverse) {
freqa = txbasefreq + (bandwidth / 2.0);
freqb = txbasefreq - (bandwidth / 2.0);
@ -96,22 +101,27 @@ void olivia::send_preamble()
freqb = txbasefreq + (bandwidth / 2.0);
}
for (i = 0; i < sr4; i++)
outbuf[i] = nco(freqa);
for (i = sr4; i < 2*sr4; i++)
outbuf[i] = nco(freqb);
for (i = 2*sr4; i < 3*sr4; i++)
outbuf[i] = nco(freqa);
for (i = 3*sr4; i < samplerate; i++)
outbuf[i] = nco(freqb);
for (i = 0, j = 0; i < sr4; i++, j++)
outbuf[i] = nco(freqa) * ampshape[j];
for (i = sr4, j = 0; i < 2*sr4; i++, j++)
outbuf[i] = nco(freqb) * ampshape[j];
for (i = 2*sr4, j = 0; i < 3*sr4; i++, j++)
outbuf[i] = nco(freqa) * ampshape[j];
for (i = 3*sr4, j = 0; i < samplerate; i++, j++)
outbuf[i] = nco(freqb) * ampshape[j];
ModulateXmtr(outbuf, samplerate);
}
void olivia::send_postamble()
{
double freqa, freqb;
int i, sr4 = samplerate / 4;
int i, j, sr4 = samplerate / 4;
double ampshape[sr4];
for (int i = 0; i < sr4; i++) ampshape[i] = 1.0;
for (int i = 0; i < sr4 / 8; i++)
ampshape[i] = ampshape[sr4 - 1 - i] = 0.5 * (1.0 - cos(M_PI * i / (sr4/8)));
if (reverse) {
freqa = txbasefreq + (bandwidth / 2.0);
freqb = txbasefreq - (bandwidth / 2.0);
@ -120,14 +130,14 @@ void olivia::send_postamble()
freqb = txbasefreq + (bandwidth / 2.0);
}
for (i = 0; i < sr4; i++)
outbuf[i] = nco(freqa);
for (i = sr4; i < 2*sr4; i++)
outbuf[i] = nco(freqb);
for (i = 2*sr4; i < 3*sr4; i++)
outbuf[i] = nco(freqa);
for (i = 3*sr4; i < samplerate; i++)
outbuf[i] = nco(freqb);
for (i = 0, j = 0; i < sr4; i++, j++)
outbuf[i] = nco(freqa) * ampshape[j];
for (i = sr4, j = 0; i < 2*sr4; i++, j++)
outbuf[i] = nco(freqb) * ampshape[j];
for (i = 2*sr4, j = 0; i < 3*sr4; i++, j++)
outbuf[i] = nco(freqa) * ampshape[j];
for (i = 3*sr4, j = 0; i < samplerate; i++, j++)
outbuf[i] = nco(freqb) * ampshape[j];
ModulateXmtr(outbuf, samplerate);
}