Harmonic number
This commit is contained in:
parent
e94e996db1
commit
58adc4a97e
1 changed files with 23 additions and 17 deletions
|
@ -104,7 +104,7 @@ void SimpleTestFileIQ(uint64_t Freq)
|
||||||
CIQBuffer[i]=std::complex<float>(IQBuffer[i*2]/32768.0,IQBuffer[i*2+1]/32768.0);
|
CIQBuffer[i]=std::complex<float>(IQBuffer[i*2]/32768.0,IQBuffer[i*2+1]/32768.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
iqtest.SetIQSamples(CIQBuffer,nbread/2);
|
iqtest.SetIQSamples(CIQBuffer,nbread/2,1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -252,7 +252,7 @@ void SimpleTestAm(uint64_t Freq)
|
||||||
void SimpleTestOOK(uint64_t Freq)
|
void SimpleTestOOK(uint64_t Freq)
|
||||||
{
|
{
|
||||||
|
|
||||||
int SR=1000;
|
int SR=2000;
|
||||||
int FifoSize=512;
|
int FifoSize=512;
|
||||||
amdmasync amtest(Freq,SR,14,FifoSize);
|
amdmasync amtest(Freq,SR,14,FifoSize);
|
||||||
|
|
||||||
|
@ -260,10 +260,11 @@ void SimpleTestOOK(uint64_t Freq)
|
||||||
int count=0;
|
int count=0;
|
||||||
int Every=SR/100;
|
int Every=SR/100;
|
||||||
float x=0.0;
|
float x=0.0;
|
||||||
|
|
||||||
while(running)
|
while(running)
|
||||||
{
|
{
|
||||||
//usleep(FifoSize*1000000.0*1.0/(8.0*SR));
|
//usleep(FifoSize*1000000.0*1.0/(8.0*SR));
|
||||||
usleep(100);
|
usleep(1);
|
||||||
int Available=amtest.GetBufferAvailable();
|
int Available=amtest.GetBufferAvailable();
|
||||||
if(Available>256)
|
if(Available>256)
|
||||||
{
|
{
|
||||||
|
@ -271,13 +272,13 @@ void SimpleTestOOK(uint64_t Freq)
|
||||||
for(int i=0;i<Available;i++)
|
for(int i=0;i<Available;i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//if((count/Every)%4>2) x=0; else x=1;
|
if(count<1000)
|
||||||
//x+=(1.0/(float)SR*10.0);
|
x=0;
|
||||||
x+=0.0001;
|
else
|
||||||
if(x>1.0) x=0;
|
x=1.0;
|
||||||
|
|
||||||
amtest.SetAmSample(Index+i,x);
|
amtest.SetAmSample(Index+i,x);
|
||||||
count++;
|
count++;
|
||||||
|
if(count>2000) count=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +290,7 @@ void SimpleTestBurstFsk(uint64_t Freq)
|
||||||
|
|
||||||
//int SR=40625;
|
//int SR=40625;
|
||||||
int SR=40625;
|
int SR=40625;
|
||||||
int Deviation=26370;
|
float Deviation=26370;
|
||||||
int FiFoSize=4000;
|
int FiFoSize=4000;
|
||||||
fskburst fsktest(Freq,SR,Deviation,14,FiFoSize);
|
fskburst fsktest(Freq,SR,Deviation,14,FiFoSize);
|
||||||
|
|
||||||
|
@ -299,14 +300,19 @@ void SimpleTestBurstFsk(uint64_t Freq)
|
||||||
while(running)
|
while(running)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<FiFoSize;i++)
|
int BurstLen=rand()%FiFoSize;
|
||||||
|
for(i=0;i<BurstLen;i++)
|
||||||
{
|
{
|
||||||
TabSymbol[i]=(i/10)%2;
|
TabSymbol[i]=rand()%2;
|
||||||
|
}
|
||||||
|
fsktest.SetSymbols(TabSymbol,BurstLen);
|
||||||
|
sleep(1);
|
||||||
|
/*for(i=0;i<FiFoSize;i++)
|
||||||
|
{
|
||||||
|
TabSymbol[i]=1;
|
||||||
}
|
}
|
||||||
fsktest.SetSymbols(TabSymbol,FiFoSize);
|
fsktest.SetSymbols(TabSymbol,FiFoSize);
|
||||||
sleep(1);
|
sleep(1);*/
|
||||||
fsktest.SetSymbols(TabSymbol,FiFoSize/2);
|
|
||||||
sleep(1);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -338,11 +344,11 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
//SimpleTest(Freq);
|
//SimpleTest(Freq);
|
||||||
//SimpleTestbpsk(Freq);
|
//SimpleTestbpsk(Freq);
|
||||||
SimpleTestFileIQ(Freq);
|
//SimpleTestFileIQ(Freq);
|
||||||
//SimpleTestDMA(Freq);
|
//SimpleTestDMA(Freq);
|
||||||
//SimpleTestAm(Freq);
|
//SimpleTestAm(Freq);
|
||||||
//SimpleTestOOK(Freq);
|
//SimpleTestOOK(Freq);
|
||||||
//SimpleTestBurstFsk(Freq);
|
SimpleTestBurstFsk(Freq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue