jgaeddert / liquid-dsp

digital signal processing library for software-defined radios
http://liquidsdr.org
MIT License
1.87k stars 439 forks source link

[Question] Is the tail of the sequence created by `qdetector_*_create_gmsk` correct? #377

Open xerpi opened 1 month ago

xerpi commented 1 month ago

qdetector_*_create_gmsk calls gmskmod_modulate with the _sequence symbols passed (of length _sequence_len) plus the 2*_m extra symbols corresponding to the filter delay (_m). Those extra symbol delay symbols are passed as 0s:

https://github.com/jgaeddert/liquid-dsp/blob/9f32eb7b956738ac18d6d19ac0a7da5ea6e1e5a0/src/framing/src/qdetector.proto.c#L211-L212

Since we are making the extra symbols a "hard" 0, the generated samples' phase looks like: image This was generated by calling qdetector_cccf_create_gmsk with:

Notice how the tail stays at a "low position". Shouldn't the tail be all 0s instead? Otherwise when correlating, those samples will have an influence. I have the impression that something like this would be desirable: image

xerpi commented 1 month ago

I've played a bit around it. I have added a new function, gmskmod_modulate_raw which lets you pass the raw sample value (_x), then at qdetector_*_create_gmsk I have splitted the for (i=0; i<_sequence_len + 2*_m; i++) loop into two:

  1. for (i=0; i<_sequence_len; i++) which just calls gmskmod_modulate
  2. for (i=0; i<2*_m; i++) which calls the new gmskmod_modulate_raw passing 0.0f as the sample value

This generates the follow sample sequence: image Notice how the tail of the phase (green) goes to 0.