[pskmail] Re: Robust psk-modes on raspberry pi

  • From: John Douyere <vk2eta@xxxxxxxxx>
  • To: pskmail@xxxxxxxxxxxxx
  • Date: Wed, 20 Nov 2013 01:25:41 +1100

No apologies needed Franco, my post here was done after your email.

I just didn't see it before I posted in the Fldigi list.

I just mentioned it for consistency only.

Thanks for your help in resolving that bug.

All the best,

73, John
On Nov 20, 2013 12:13 AM, "Franco Spinelli" <frspin@xxxxxxxxx> wrote:

> I apologize for that but I am at work and have Gmail but no Fldigi group
> access.
>
> Regards
>
> Franco Spinelli
> IW2DHW
>
>
>
> 2013/11/19 John Douyere <vk2eta@xxxxxxxxx>
>
>> As I posted in the fldigi group, I have found that I get the best results
>> with the code below, and I have proposed it to Dave for inclusion.
>>
>> I find that using the impact of the amplitude improves the decoding.
>>
>> Regards,
>>
>> John
>>
>> // Soft decode section below
>> averageamp = decayavg(averageamp, sigamp, SQLDECAY);
>>  if (sigamp > 0 && averageamp > 0) {
>> if (sigamp > averageamp) {
>>  softamp = clamp( sqrt(sigamp / averageamp), 1.0, 1e6);
>> } else {
>> softamp = clamp( sqrt(averageamp / sigamp), 1.0, 1e6);
>>  }
>> } else {
>> softamp = 2; // arbritary number (50% impact)
>>  }
>> // Compute values between -128 and +127 for phase value only
>> if (phase > M_PI) {
>>  softangle = (127 - (((2 * M_PI - phase) / M_PI) * (double) 255));
>> } else {
>>  softangle = (127 - ((phase / M_PI) * (double) 255));
>> }
>> // Then apply impact of amplitude. Finally, re-centre on 127-128
>>  // as the decoder needs values between 0-255
>> softbit = (unsigned char) ((softangle / ( 0.5 + softamp / 2 )) + 128);
>>  n = 2;
>> }
>>
>>
>>
>> On Tue, Nov 19, 2013 at 11:02 PM, Franco Spinelli <frspin@xxxxxxxxx>wrote:
>>
>>>
>>>
>>>
>>> 2013/11/19 John Douyere <vk2eta@xxxxxxxxx>
>>>
>>>> Tarmo,
>>>>
>>>> The following patch fixes the bug. It exists also in X86 architectures
>>>> but it resolves differently and works regardless!
>>>>
>>>> In psk.cxx, in the subroutine rx_symbol(...), replace the line:
>>>>
>>>>                softbit = (unsigned char) ((softangle / (1 + softamp)) -
>>>> 127);
>>>> by:
>>>>
>>>>                softbit = (unsigned char) ((softangle / (1 + softamp)) +
>>>> 127);
>>>>
>>>> It has worked for others.
>>>>
>>>>
>>>>
>>> Is this the correction to apply to source of Fldigi or is as indicated
>>> by David and committed to git:
>>>
>>> softbit = round(softangle / softamp + 128);
>>>
>>> Are both working? And which of proposed patch is better?
>>>
>>> Regards
>>>
>>> Franco Spinelli
>>> IW2DHW
>>>
>>
>>
>

Other related posts: