projekte:iqmod:start
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
projekte:iqmix [2014/02/03 20:36] – [Anleitung zur Inbetriebnahme] Schaltplan-Änderungen yc | projekte:iqmix [2014/02/05 08:33] – [Schaltplan] yc | ||
---|---|---|---|
Zeile 279: | Zeile 279: | ||
^ Dämpfung ^ R15,R16 ^ R14,R17 ^ R18^ | ^ Dämpfung ^ R15,R16 ^ R14,R17 ^ R18^ | ||
| 0dB | - | 100Ω | - | | | 0dB | - | 100Ω | - | | ||
- | | -25dB | 120Ω | 56Ω | | + | | -20dB | 120Ω | 56Ω | 237Ω | |
+ | | -25dB | 120Ω | 56Ω | | ||
Links zu den verwendeten Schaltkreisen: | Links zu den verwendeten Schaltkreisen: | ||
Zeile 363: | Zeile 364: | ||
- Verpolungstest: | - Verpolungstest: | ||
- Bestückung X1(SMA, LO-Eingang) und Filter ohne Dämpfungsglied; | - Bestückung X1(SMA, LO-Eingang) und Filter ohne Dämpfungsglied; | ||
- | - VNWA-Messung LO-Filter | + | - VNWA-Messung LO-Filter: {{: |
- Spektrum Si570 mit Filter: {{: | - Spektrum Si570 mit Filter: {{: | ||
- Bestückung Rest, 50Ohm-Abschluss an X1 + X2 | - Bestückung Rest, 50Ohm-Abschluss an X1 + X2 | ||
Zeile 378: | Zeile 379: | ||
{{: | {{: | ||
+ | |||
+ | ===== Ansteuerung ===== | ||
+ | Um normale Audio-Dateien FM-moduliert als I/Q-Signale mit einer Soundkarte ausgeben zu können, gibt es folgendes kleines Tool: **fmmod** | ||
+ | |||
+ | <file c fmmod.c> | ||
+ | /* complex frequency modulator for i/q signal processing | ||
+ | * Sebastian Weiss < | ||
+ | * Di 4. Feb 16:10:01 CET 2014 | ||
+ | */ | ||
+ | |||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | #define BUFFER_LEN | ||
+ | |||
+ | void usage(void) | ||
+ | { | ||
+ | printf(" | ||
+ | inputfile: path to input file(needs to be single channel)\n \ | ||
+ | outputfile: path to output file\n \ | ||
+ | carrier: carrier frequency in Hz(standard: | ||
+ | freqdev: frequency deviation in Hz(standard: | ||
+ | } | ||
+ | |||
+ | void process_data(double *data, int count, int fs, double fc, double freqdev) | ||
+ | { | ||
+ | static double old_phase = 0.0; | ||
+ | double cumsum[BUFFER_LEN]; | ||
+ | double phase; | ||
+ | int i; | ||
+ | |||
+ | if (count == 0) | ||
+ | return; | ||
+ | |||
+ | cumsum[0] = data[0]/fs; | ||
+ | for (i = 1; i < count; i++) { | ||
+ | cumsum[i] = cumsum[i-1] + data[i]/fs; | ||
+ | } | ||
+ | |||
+ | for (i=0; i < count; i++) { | ||
+ | phase = 2*M_PI*fc/ | ||
+ | data[2*i] = cos(phase); | ||
+ | data[2*i + 1] = -sin(phase); | ||
+ | } | ||
+ | |||
+ | old_phase = fmod(phase, 2*M_PI); | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | int main(int argc, char *argv[]) | ||
+ | { | ||
+ | static double data[2*BUFFER_LEN]; | ||
+ | SNDFILE *infile, *outfile; | ||
+ | SF_INFO sfinfo; | ||
+ | int readcount; | ||
+ | double carrier; | ||
+ | double freqdev; | ||
+ | |||
+ | if ((argc > 5) || (argc < 3)) { | ||
+ | usage(); | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | freqdev = (argc == 5) ? atof(argv[4]) : 3000.0; | ||
+ | carrier = (argc > 3) ? atof(argv[3]) : 0.0; | ||
+ | |||
+ | infile = sf_open(argv[1], | ||
+ | if (!infile) { | ||
+ | printf(" | ||
+ | sf_perror(NULL); | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | if (sfinfo.channels > 1) { | ||
+ | printf(" | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | sfinfo.channels = 2; | ||
+ | |||
+ | outfile = sf_open(argv[2], | ||
+ | if (!outfile) { | ||
+ | printf(" | ||
+ | sf_perror(NULL); | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | while ((readcount = sf_read_double(infile, | ||
+ | process_data(data, | ||
+ | sf_write_double(outfile, | ||
+ | } | ||
+ | |||
+ | sf_close(infile); | ||
+ | sf_write_sync(outfile); | ||
+ | sf_close(outfile); | ||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | |||
+ | </ |
projekte/iqmod/start.txt · Zuletzt geändert: 2022/08/04 10:37 von yc