Skip to content

Commit

Permalink
Update mod-test
Browse files Browse the repository at this point in the history
  • Loading branch information
srsampson committed Mar 18, 2020
1 parent bc5eeac commit 06b1bd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Binary file modified libfsk.so
Binary file not shown.
7 changes: 4 additions & 3 deletions mod-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define CYCLES (FS / RS)

int main() {
struct MODULATE *mod;
FILE *fout;
int i, j;

Expand All @@ -23,7 +24,7 @@ int main() {
return 1;
}

if (mod_create(MODE, FS, RS, FIRST_TONE_FREQ, SHIFT_FREQ) == 0) {
if ((mod = mod_create(MODE, FS, RS, FIRST_TONE_FREQ, SHIFT_FREQ)) == NULL) {
fprintf(stderr, "Unable to create modulator\n");
return 2;
}
Expand All @@ -34,7 +35,7 @@ int main() {
for (i = 0; i < 512; i++) {
int bitpair = (rand() % MODE);

modulate(baseband, bitpair);
modulate(mod, baseband, bitpair);

for (j = 0; j < CYCLES; j++) {
// 50% modulation
Expand All @@ -45,7 +46,7 @@ int main() {
fwrite(word, sizeof (short), CYCLES, fout);
}

mod_destroy();
mod_destroy(mod);
fclose(fout);

return 0;
Expand Down

0 comments on commit 06b1bd9

Please sign in to comment.