kopia lustrzana https://github.com/F5OEO/rpitx
Add Spectrum paint - Need to check level and imagick YUB format
rodzic
c24acb13b4
commit
fd71868432
|
@ -0,0 +1,10 @@
|
|||
raspistill -w 320 -h 256 -o picture.jpg -t 1
|
||||
#convert picture.jpg -flip -colors 16 -colorspace gray -dither -colorspace YUV picture.yuv
|
||||
convert picture.jpg -flip -colors 16 -colorspace gray -colorspace YUV picture.yuv
|
||||
sudo ./spectrumpaint picture.yuv 144.2e6
|
||||
|
||||
#convert -depth 8 picture.jpg picture.rgb
|
||||
|
||||
#sudo ./pisstv picture.rgb 144.5e6
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#all: ../rpitx ../pissb ../pisstv ../pifsq ../pifm ../piam ../pidcf77
|
||||
all: ../pisstv ../piopera ../pifsq ../pichirp ../sendiq ../tune ../freedv ../dvbrf ../pocsag
|
||||
all: ../pisstv ../piopera ../pifsq ../pichirp ../sendiq ../tune ../freedv ../dvbrf ../pocsag ../spectrumpaint
|
||||
|
||||
CFLAGS = -Wall -g -O2 -Wno-unused-variable
|
||||
LDFLAGS = librpitx/src/librpitx.a -lm -lrt -lpthread
|
||||
|
@ -47,6 +47,9 @@ LDFLAGS_Pissb = librpitx/src/librpitx.a -lm -lrt -lpthread -lsndfile -lliquid
|
|||
../pocsag: pocsag/pocsag.cpp librpitx/src/librpitx.a
|
||||
$(CCP) $(CFLAGS) -o ../pocsag pocsag/pocsag.cpp $(LDFLAGS)
|
||||
|
||||
../spectrumpaint: spectrumpaint/spectrum.cpp librpitx/src/librpitx.a
|
||||
$(CCP) $(CFLAGS) -o ../spectrumpaint spectrumpaint/spectrum.cpp $(LDFLAGS)
|
||||
|
||||
CFLAGS_Pifm = -Wall -g -O2 -Wno-unused-variable
|
||||
LDFLAGS_Pifm = librpitx/src/librpitx.a -lm -lrt -lpthread -lsndfile
|
||||
../pifm : ../fm/pifm.c
|
||||
|
|
|
@ -331,7 +331,7 @@ void SendFsk(uint64_t Freq,uint32_t *Message,int Size)
|
|||
//int SR=40625;
|
||||
int SR=1200;
|
||||
float Deviation=4500;
|
||||
int FiFoSize=4000;
|
||||
int FiFoSize=12000;
|
||||
fprintf(stderr,"Fifo Size =%d, Size = %d",FiFoSize,Size);
|
||||
fskburst fsktest(Freq,SR,Deviation,14,FiFoSize);
|
||||
unsigned char *TabSymbol=(unsigned char *)malloc(Size*32);
|
||||
|
|
|
@ -156,7 +156,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
int SR=48000;
|
||||
int FifoSize=IQBURST*4;
|
||||
iqdmasync iqtest(SetFrequency,SampleRate,14,FifoSize);
|
||||
iqdmasync iqtest(SetFrequency,SampleRate,14,FifoSize,MODE_IQ);
|
||||
iqtest.SetPLLMasterLoop(3,4,0);
|
||||
iqtest.print_clock_tree();
|
||||
//iqtest.SetPLLMasterLoop(5,6,0);
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "../librpitx/src/librpitx.h"
|
||||
|
||||
int FilePicture;
|
||||
int FileFreqTiming;
|
||||
|
||||
iqdmasync *fmmod;
|
||||
static double GlobalTuningFrequency=00000.0;
|
||||
int FifoSize=35000;
|
||||
|
||||
|
||||
void ProcessPicture(float Excursion)
|
||||
{
|
||||
|
||||
int EndOfPicture=0;
|
||||
int NbRead=0;
|
||||
int VIS=1;
|
||||
static unsigned char Line[320*3];
|
||||
std::complex<float> sample[320];
|
||||
int Row;
|
||||
|
||||
|
||||
while(EndOfPicture==0)
|
||||
{
|
||||
NbRead=read(FilePicture,Line,320);
|
||||
if(NbRead!=320) EndOfPicture=1;
|
||||
|
||||
|
||||
for(Row=0;Row<320;Row++)
|
||||
{
|
||||
sample[Row]=std::complex<float>((Row/320.0-0.5)*Excursion,(Line[Row])/4);
|
||||
|
||||
|
||||
}
|
||||
fmmod->SetIQSamples(sample,320,1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
float frequency=144.5e6;
|
||||
float Excursion=100000;
|
||||
if (argc > 2)
|
||||
{
|
||||
char *sFilePicture=(char *)argv[1];
|
||||
FilePicture = open(argv[1], O_RDONLY);
|
||||
|
||||
frequency=atof(argv[2]);
|
||||
}
|
||||
if (argc > 3)
|
||||
{
|
||||
Excursion=atof(argv[3]);
|
||||
}
|
||||
if(argc<2)
|
||||
{
|
||||
printf("usage : spectrum picture.rgb frequency(Hz) Excursion(Hz)\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
fmmod=new iqdmasync(frequency,10000,14,FifoSize,MODE_FREQ_A);
|
||||
ProcessPicture(Excursion);
|
||||
close(FilePicture);
|
||||
delete fmmod;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Ładowanie…
Reference in New Issue