Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 67 of 67

Thread: AudioSDR - A single Audio block SDR (software defined radio) processor/demodulator

  1. #51
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    163
    Hi Frank: Thanks for setting me straight on this. That's how I had remembered things- it was only when I saw another post that I thought differently. Seems like the dedicated ADC (PCM1808) is better than codecs in this regard. I was interested to see you had also used various STM32 MCUs with SDR software. I have a STM32F746 Discovery board which I thought would be great for such projects as it has a beautiful 4.3" capacitive touchscreen and a WM8994 audio codec. I used it for some projects but cannot get the audio line in and audio line out to work simultaneously (microphone in and line out is OK). Others have had the same problem, but I expect someone out there has figured it out.
    I've tried to use the STM32Cube IDE but find it very difficult to get used to, but I've been more successful using the Mbed platform- it's somewhat like the Teensy in good support, libraries etc.
    I just figured out that the Audio library ADCS component has not yet been ported to the T4.x, so my idea of using the internal dual 12-bit ADC is a non-starter.
    Cheers
    Brian

  2. #52
    Junior Member
    Join Date
    Jan 2017
    Posts
    9
    Quote Originally Posted by bmillier View Post
    Hi Frank: Thanks for setting me straight on this. That's how I had remembered things- it was only when I saw another post that I thought differently. Seems like the dedicated ADC (PCM1808) is better than codecs in this regard. I was interested to see you had also used various STM32 MCUs with SDR software. I have a STM32F746 Discovery board which I thought would be great for such projects as it has a beautiful 4.3" capacitive touchscreen and a WM8994 audio codec. I used it for some projects but cannot get the audio line in and audio line out to work simultaneously (microphone in and line out is OK). Others have had the same problem, but I expect someone out there has figured it out.
    I've tried to use the STM32Cube IDE but find it very difficult to get used to, but I've been more successful using the Mbed platform- it's somewhat like the Teensy in good support, libraries etc.
    I just figured out that the Audio library ADCS component has not yet been ported to the T4.x, so my idea of using the internal dual 12-bit ADC is a non-starter.
    Cheers
    Brian
    Hi Brian,
    I just came across your post, mentioning the F746 board. I have experimented with this board and have managed get the audio in/out part to work. I am now experimenting with Derek Rowell's AudioDSP library, but the going is slow as the STM32 development environment (as you mentioned) is daunting to say the least. However, I'd be more than pleased to share experiences if you are interested.
    Jan

  3. #53
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    163
    Hi Jan:
    I gather you are also interested in other MCUs beyond the Teensys. Are you saying that you have gotten line in and line out working simultaneously. That is what I couldn't achieve and there were forum posts saying something about needing a separate I2S channel for line in and line out, and that there was only 1 channel associated with the Codec. Didn't seem to make much sense as the on-board microphone is handled by the codec and mic. in/ line out work together. But, even when I dug into the BSP library code for the codec, I couldn't get both working at once.
    I heard about the AudioDSP, but never looked into it since I couldn't solve the basic line in/line out issue. We are truly spoiled with Teensy as the Audio library is very good. While I'd be hard-pressed to write a DSP lib. function in STM32Cube IDE, I have written several custom ones for the Teensy audio library.
    I'd be interested in hearing how you are progressing. To be honest though, I am only comfortable using the Mbed IDE,I never got comfortable with STM32Cube. Similarly, the Silicon Labs MCUs use an eclipse-based IDE which I found awful to learn, and reverted to Mbed on that MCU as well.
    Cheers

  4. #54
    Junior Member
    Join Date
    Jan 2017
    Posts
    9
    Hi Brian,
    all that steered you away from STM32Cube is valid. It's not only Eclipse that takes getting used to, but the STM32 IDE plugin is very hard to get a handle on and I have found it error prone. The one reason I am not giving up is a very good graphics environment with TouchGFX, but that too is not for the daunted. The "line-in to line-out" audio path can indeed be made to work without an additional I2S channel, but it takes wading through such things as incompatible handler names between the STM32 audio library and the initialization code that CubeMX generates for an F746 discovery board. Explaining 'how to' means dragging you into the STM32 IDE, not where you'd want to go. Maybe one day I'll try Mbed as well, or simply stick to Teensy

  5. #55
    Senior Member
    Join Date
    May 2016
    Posts
    256
    Updates: Hi everybody! I've been involved in a large ESP32 project (a stand-alone WSPR beacon, with 20+ units now deployed) for several months and away from the forum, but still working on AudioSDR, and using it daily. A couple of things:

    1) I have just uploaded an update to GitHub. It includes a bugfix for the AM demodulator that caused severe audio distortion, and changes to the PLL for the SAM demodulator to improve the carrier lock. I also removed the EXAMPLES folder, which should never have been there Link here
    2) The SDR works well on the T4.1. I continue to work on the UI, and the rf preprocessor. Here is an image of the ILI9341 2.8" display with spectrum and signal strength:
    Click image for larger version. 

Name:	sdrSpectrum.jpg 
Views:	78 
Size:	153.9 KB 
ID:	24203
    The yellow stripe on the spectrum shows the tuning band. I have struggled to develop a waterfall display, with no satisfactory solution.

    A second screen shot shows an example of my encoder-based menu system for selecting/changing system parameters.
    Click image for larger version. 

Name:	sdrMenu.jpg 
Views:	70 
Size:	121.9 KB 
ID:	24202
    (I find that the touch screen is just too hard to use for small menu buttons)

    I have not published the whole system code because of the dependencies on my homebrew receiver rf front end, and the structure of the user interface (encoders, pots, tactile push buttons etc). However, if anybody wants the whole package just let me know by PM with your email, and I'll send you a zip with the whole bundle. You'll be on your own to work out what's going on

    I am currently working on adding a transmitter to make a complete transceiver. I have the Teensy based DSP audio processing (compression, shaping, Hilbert transfom (phase-shifter)) done, and am now working on the hardware RF mixers and amplifiers. It's stand-alone right now but the goal is to make it a fully integrated transceiver.
    Last edited by DerekR; 03-27-2021 at 02:18 PM.

  6. #56
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    137
    Hi Derek, thanks for updating your SDR library ..There are members on my Facebook Group (Keiths_SDR) that are using it for their receiver builds ..Im also running the 2.8" touch panel as well as the ili9488 3.5" touch panel ..and I agree the 2.8" is just a touch undersized for touch ..

    Cheers
    K

  7. #57
    Senior Member
    Join Date
    May 2016
    Posts
    256
    Another quick GitHub update: Just to let you know that I"ve just uploaded another update with minor changes:
    1. A more recent version of the manual (with source code for BareBonesWSPR)
    2. An EXTRAS folder with the .ino for BareBonesWSPR, and a copy of my library SI5351quad, which generates quadrature outputs directly on channels 0 and 1 of the SI5351A oscillator, without generating an x4 frequency and using a Johnson counter to create the quadrature pair.

  8. #58
    Junior Member
    Join Date
    Apr 2021
    Location
    Ladrboke UK
    Posts
    2
    Any chance of TX?

  9. #59
    Senior Member
    Join Date
    May 2016
    Posts
    256
    Quote Originally Posted by AntonyWatts View Post
    Any chance of TX?
    Yes... I'm working on it! Right now I have the SDR part (Audio processing, IQ generation etc) working in a stand-aloe config, and am concentrating of the RF hardware side (mixers. QRP linear amplifier, filters). The goal is to integrate the RX and TX after both are working,
    Derek, AK1WI

  10. #60
    Junior Member
    Join Date
    Apr 2021
    Location
    Ladrboke UK
    Posts
    2

    One more thing

    Quote Originally Posted by DerekR View Post
    Yes... I'm working on it! Right now I have the SDR part (Audio processing, IQ generation etc) working in a stand-aloe config, and am concentrating of the RF hardware side (mixers. QRP linear amplifier, filters). The goal is to integrate the RX and TX after both are working,
    Derek, AK1WI
    I am working to get your RX version working, but I am on a MacBook. You only have instructions of how to load the arm...h files on a PC, do you have info how / where to copy them to on a Mac?

    Front end here is either a QCX+ or an Elektor SDR board, IQ outputs. Hope this will work! Eventually I hope to follow you and get a TX/RX going, simple OLED display, nothing fancy... Activity on GanymedeHam.blogspot.com

  11. #61
    Senior Member
    Join Date
    May 2016
    Posts
    256
    Quote Originally Posted by AntonyWatts View Post
    I am working to get your RX version working, but I am on a MacBook. You only have instructions of how to load the arm...h files on a PC, do you have info how / where to copy them to on a Mac?
    Sorry, I don't have any real experience with a Mac. Since it is just a matter of substituting files in the Teensy folders, can you find the appropriate place on the Mac?

  12. #62
    Hi Derek!

    Anything new to report on the transceiver project? Did you make any progress on the waterfall display?

    Joe
    W3JDR

  13. #63
    Junior Member
    Join Date
    Sep 2021
    Posts
    2
    Hi

    I need some help/guidance with a spectrum display for the receiver project . I have a 40m SSB/CW receiver version working with switching filters/AGC/mode etc and a RA8875 5inch display..

    But I am having problems with the code for a spectrum display. Any FFT code fragments for a basic spectrum display would be very helpful.

    Thanks
    Bob G3PJT

  14. #64
    Junior Member
    Join Date
    Sep 2021
    Posts
    2
    Thanks Derek - problem solved

    Bob

  15. #65
    Junior Member
    Join Date
    Apr 2021
    Posts
    16

    PhaseChange() on T4 with OpenAudio_Library F32 working

    I got Ron's PhaseChange() to work on the Teensy 4 to remove images using OpenAudio_Library 32bit floating point objects.

    Had to make some changes.
    1. Change the int16_t arrays to float32_t
    2. Change the 32767 to 1.0f

    Plugged in the begin() functions after the sgtl5000.enable().
    ex: PhaseQ.begin(PhaseIfir, 2);

    I assigned PhaseChanges(1) to a button to cycle through the 3 combos.


    Code follows with some usage comments added
    __________________________________________________ ______________________________________________

    HTML Code:
    //     Manual I2S codec Phase Correction Utility by Ron Carr
    //     Reference: [URL]https://forum.pjrc.com/threads/57362-AudioSDR-A-single-Audio-block-SDR-(software-defined-radio)-processor-demodulator?p=263048&viewfull=1#post263048[/URL]
    //      Updated for Teensy 4.0/1 using the OpenAudio_Library (F32) by K7MDL on 24 Feb 2022
    //
    //    Usage: Paste in the code below as-is in the appropriate sections.
    //        There is nothing to configure.
    //        Normally you would attach the function PhaseChange(1) to a user control.
    //        When you see a mirror image at startup, operate the control to try each of
    //            the 3 combos until you see the mirror image go away. 
    //
    //.............................
    //     Phase correction FIRs. Apparently sometimes the I2s audio samples are 1 step out of phase
    //         and waterfall shows very little opposite sideband suppression
    //
    float32_t  PhaseIfir[2] = { 1.0f, 0 };    // swap constants to change phasing
    float32_t  PhaseQfir[2] = { 1.0f, 0 };
    //.............................
    
    
    // Your pgrogam should already have these lines
    float sample_rate_Hz = 48000.0f;  // set to your preference
    const int   audio_block_samples = 128;          // do not change this!
    AudioSettings_F32           audio_settings(sample_rate_Hz, audio_block_samples);  
    
    
    // Add the below code in the approriate places
    AudioFilterFIR_F32          PhaseI(audio_settings);
    AudioFilterFIR_F32          PhaseQ(audio_settings);
    
    
    // Attach PhaseI and PhaseQ to the i2s inputs.  Here is an example.
    AudioConnection_F32     patchCord_RX_In_L(Input,0,  PhaseI,0);  // route raw input audio to the FFT display
    AudioConnection_F32     patchCord_RX_In_R(Input,1,  PhaseQ,0);
    AudioConnection_F32     patchCord_RX_Ph_L(PhaseI,0, I_Switch,0);  // route raw input audio to the FFT display
    AudioConnection_F32     patchCord_RX_Ph_R(PhaseQ,0, Q_Switch,0);
    
    
    //    ------------------- PhaseChange() -------------------------------------
    // I2S audio sometimes starts with I and Q out of order
    //    --------------------------------- -------------------------------------
    void PhaseChange(uint8_t chg)
    {
       static int val;
    
    
       if( chg ){
       if( ++val > 2 ) val = 0;                            // rotate through the settings
       }
          // print 
       Serial.print("Ph:  ");
    
    
       switch( val ){
       case 0:  
          PhaseIfir[0] = 1.0f;   PhaseIfir[1] = 0;        // normal in phase
          PhaseQfir[0] = 1.0f;   PhaseQfir[1] = 0;
          Serial.println("1010");
       break;
       case 1:
          PhaseIfir[0] = 1.0f;   PhaseIfir[1] = 0;    
          PhaseQfir[0] = 0;      PhaseQfir[1] = 1.0f;    // delay Q  ( delay I if fir runs backward )
          Serial.println("1001");
       break;
       case 2:
          PhaseIfir[0] = 0;      PhaseIfir[1] = 1.0f;    // delay I
          PhaseQfir[0] = 1.0f;   PhaseQfir[1] = 0;
          Serial.println("0110");
          break;
       }  
    }
    
    
    
    setup()
    {
       PhaseI.begin(PhaseIfir, 2);
       PhaseQ.begin(PhaseQfir, 2);
    }
    
    
    loop()
    {
    
    
     . . .
    
    
       // Call this from a UI control to manually try al l3 combos.  
       // A value of 1 will cause the function increment the count internally to the function
       PhaseChange(1);  // deal with "twin-peaks problem" - 3 combos, call this until the problem goes away
    
    
    . . . 
    
    
    }

  16. #66
    Junior Member
    Join Date
    Apr 2021
    Posts
    16
    I converted AudioSDRpreProcessor to f32 to be compatible with OpenAudio_Library and Teensy 4.x. I and using it in my Teensy 4 based RA887x_SDR radio and tweaked and seems to be working well after tweaking some variables. In my app I have a #define to choose between the PhaseChange() manual method vs this Auto-method as one prefers to help ease further testing of both methods.

    There are 2 files at https://github.com/K7MDL2/KEITHSDR
    AudioSDRpreProcessor_F32.h
    AudioSDRpreProcessor_F32.cpp

    I also pasted them into a PullRequest at https://github.com/DerekRowell/AudioSDR/issues/1

    Both methods seem to work fine so far.

    Mike K7MDL

  17. #67
    Junior Member
    Join Date
    Feb 2023
    Posts
    1
    Recently found the GitHub AudioSDR and this thread today. The thread answers some of my questions and needs some more reading and analysis. Have an unanswered question about the selection of the 6890 Hz clock. The frequency appears to be unusual from a digital point of view as opposed to 8KHz. Is this due to the digital processing or the aliasing filters? I am not yet up to speed on the DSP software and know more about hardware.

    Also have not read much here about the transmitter approach in hardware. Interested in making a single exciter for 20M, 10M and/or 6M because they are common transverter frequencies. Also looking at analog Gilbert cells [like NE602/612, ADL5375 or AD831] for the second multiplier stage, because the Tayloe performance seems to fall of at higher frequencies and perhaps these circuits may work better.

    Thanks for any comments.

    Dick K9IVB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •