Hi,

In the old version of gen_ft8wave that you have based your library on there was 
was no bug because gen_ft8wave was always called with fsample=48000 when called 
from the WSJT-X c++ code and with fsample=12000 when called from the jt9 
fortran code. 

When the “a7” decoding feature was added in WSJT-X version 2.5 the code was 
changed to allow calling with different fsample values.

73,
Steve k9an

> On May 27, 2023, at 2:53 PM, Paulh002 via wsjt-devel 
> <wsjt-devel@lists.sourceforge.net> wrote:
> 
> Hello,
> 
> I am new to this group, and have a question about the fortran code of 
> gen_ft8wave. I am using the fortran code in a c++ library to support ft8 in 
> my own sdr transceiver development on a raspberry pi. (see github 
> https://github.com/paulh002/wsjtx_lib <https://github.com/paulh002/wsjtx_lib> 
> and  https://github.com/paulh002/sdrberry 
> <https://github.com/paulh002/sdrberry>). I have made a c++ wrapper library 
> with the fortran code which works fine but for one issue.
> Sometimes the subroutine gen_ft8wave generates an incorrect ft8 wave. This 
> happens when the subroutine gen_ft8wave is first used in the decode process 
> which uses a sample rate of 12000 Hz. The subroutine saves the sample time in 
> variable dt, but when I generate a ft8 signal I use 480000 Hz and the dt 
> variable is then incorrect. (It saves the sample time on first execution).
> The other way around if you first generate a wave with 48000 Hz sample rate 
> the subroutine subtract will call gen_ft8wave with a sample frequency of 
> 12000 Hz and will receive an incorrect wave form.
> For now I fixed this by checking also the sample rate see the code snippet 
> below. My question is if this observation is correct?
> 
>  real f1
>  save pulse,twopi,dt,hmod,ibt0,ctab, f1
> 
>   ibt=nint(10*bt)
>   if(ibt0.ne.ibt .or. f1.ne.fsample) then
>      twopi=8.0*atan(1.0)
>      dt=1.0/fsample
>      hmod=1.0
> ! Compute the frequency-smoothing pulse
>      do i=1,3*nsps
>         tt=(i-1.5*nsps)/real(nsps)
>         pulse(i)=gfsk_pulse(bt,tt)
>      enddo
>      ibt0=nint(10*bt)
>      do i=0,NTAB-1
>         phi=i*twopi/NTAB
>         ctab(i)=cmplx(cos(phi),sin(phi))
>      enddo
>   endif
>   f1 = fsample
> 
> 73 PA0PHH
> _______________________________________________
> wsjt-devel mailing list
> wsjt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wsjt-devel

_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to