[hpsdr] problems using WDSP library

Eduardo Alonso ea3ghs at gmail.com
Fri May 5 06:39:01 PDT 2017


hello all,
hello Warren,

As you suggested, I tested the library using the internal generator.
I found the same problems, all times related to the frequency settings,
but not with amplitudes.

After thinking a bit, I introduced a small change, and voilá... it started
to work.
You must do casting before calling the library.
Lesson learned.

SetTXABandpassFreqs   (1,-15000,3000);                 //fails
SetTXABandpassFreqs   (1,-15000.0,3000.0);             //works
SetTXABandpassFreqs   (1,(double)-15000,(double)3000); //works

Same behavior with GCC-4.9 and CLANG-3.4...

Well, I am very happy, now I can explore all the possibilities of your
library.
Thanks for your fast answer and four your amazing contribution to the ham
community.

73 Eduardo

ps:
A last word, I was playing also with the last parameter of
OpenChannel(....,bfo).
I tried to call OpenChannel with bfo=1 without luck.
I was interested in using WDSP in a batch processing.
Maybe this problem is related to the linux port.




=== WDSP init sequence:

main()
{

OpenChannel           (1,FRAMES, 2048, 48000, 48000, 48000, 1, 0, 0.010,
0.025, 0.000, 0.010, 0);
SetTXAMode            (1,TXA_USB);
TXASetNC              (1,2048);
TXASetMP              (1,0);

//NOISE
SetTXAPreGenMode    (1,2);     //2=noise
SetTXAPreGenNoiseMag(1,0.1);

//SetTXABandpassFreqs   (1,-15000,3000); //fails
//SetTXABandpassFreqs   (1,(double)-15000,(double)3000); //work
SetTXABandpassFreqs   (1,-15000.0,3000.0); //work

SetTXAPreGenRun       (1,1);
SetChannelState       (1,1,1);
fprintf(stderr,"run\n");

while(1) {..}
}



On Tue, May 2, 2017 at 6:56 PM, Warren C. Pratt <warren at wpratt.com> wrote:

> Hello Eduardo,
>
> My first suggestion is to test with the built-in "PreGen" signal
> generator, being sure to use a tone frequency inside the filter bandwidth
> you specify.  I see in your code that you have experimented with that
> before as you have commented-out some calls to it.
>
> 73,
>
> Warren  NR0V
>
> On 5/2/2017 5:00 AM, Eduardo Alonso wrote:
>
> Hello friends,
> Hello Matt,
>
> I am having problems in my first steps with WDSP library under linux.
> With the very minimal example that I copy below, everything runs fine.
> see: http://ea3ghs.qrp.cat/332-tx-fm.png
>
> But if I call SetTXABandpassFreqs(1,-3000,3000) the output signal
> disappears !!!.
>
> This problem also appears in other modes than FM.
> I think I am not initializing correctly the library, but in
> the documentation says nothing about the correct (init) procedure.
>
> Could you give some clues?
> Thanks in advance,
> Eduardo EA3GHS
>
> //WDSP EXAMPLE
> //complete code: http://ea3ghs.qrp.cat/332c.tgz
> main()
> {
> SNDReset();
>
> OpenChannel(1, FRAMES, 2048, 48000, 48000, 48000, 1, 0, 0.010, 0.025,
> 0.000, 0.010, 0);
> SetTXAMode(1,TXA_FM);
> TXASetNC(1, 2048);
> TXASetMP(1, 0);
> //SetTXABandpassFreqs(1,-3000,3000);  //if I activate this line, I will
> have no output signal
> SetChannelState (1,1,1);
>
> while(1)
>     {
>     SNDRead(); //blocking read call
>     for(i=0;i<BUF;i++){in[i]=(double)rdbuf[i];in[i]/=0x7fff;}
>     e=0; do {fexchange0(1,in,out,&e);} while(e);
>     for(i=0;i<BUF;i++){wrbuf[i]=(s16)(out[i]*0x7fff);}
>     SNDWrite();
>     }
> }
> //END
>
> ps:
> The library version is the Linux port from John Melton, and
> inside comm.h appears a "(C) 2017 Warren Pratt, NR0V, Jae Stutzman, K5JAE"
> see http://ea3ghs.qrp.cat/332c.tgz
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openhpsdr.org/pipermail/hpsdr-openhpsdr.org/attachments/20170505/fe2b7ccc/attachment.htm>


More information about the Hpsdr mailing list