element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Wireless
  • Technologies
  • More
Wireless
Forum HackRF TX with GNURadio: Why does my spec an look like this?
  • Blog
  • Forum
  • Documents
  • Polls
  • Quiz
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Wireless to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 6 replies
  • Answers 1 answer
  • Subscribers 220 subscribers
  • Views 3103 views
  • Users 0 members are here
  • hackrf
  • sdr
  • gnuradio
  • rf
Related

HackRF TX with GNURadio: Why does my spec an look like this?

baldengineer
baldengineer over 6 years ago

I have been exploring two things: software defined radios and the frequency domain. Most of my professional career I have worked with high bandwidth oscilloscopes in signal integrity and high speed digital designs. So while I have run my fair share of FFTs and looked at jitter spectrums, my time in the frequency domain has been limited.

 

I'm using a HackRF direct feed into a R&S FPC1500 spectrum analyzer. GNURadio Companion drives the HackRF with the following flowgraph.

 

image

 

With such a setup, I am not certain I understand what effect the signal source has on the sink. Does it modulate it somehow?

 

I expected a stable 433.2 MHz carrier on my spectrum analyzer.  The green trace is a max hold and the yellow trace is averaged (10).

 

image

 

I don't understand why the signal "jumps up" every once in a while. Is it because of the "signal source" block in my flowgraph? Is it because I set something wrong on my spec an? Is it because the HackRF is doing something weird?

 

Any thoughts?

  • Sign in to reply
  • Cancel

Top Replies

  • baldengineer
    baldengineer over 6 years ago in reply to Gough Lui +1
    Gough Lui wrote: I suspect you have discontinuities in your signal from the hackRF. otherwise you might need to look at your signal in the time domain. That was my first thought. I have access to an 8…
  • baldengineer
    baldengineer over 6 years ago in reply to Gough Lui +1
    so to make it happy, perhaps set sample rate to 2M and see what happens? I'll give that a shot next. I've changed the Hack RF sample rate a number of times, but not systematically. That's a good next step…
  • Gough Lui
    0 Gough Lui over 6 years ago

    I suspect you have discontinuities in your signal from the hackRF.

     

    Check if you have buffer underflows or overflows - some SDRs have LEDs to indicate this, otherwise you might need to look at your signal in the time domain. It's similar to a sound card when the sample rate isn't quite right - you get a crackle now and then (more often if you're underflowing severely - e.g. in the case of more complex GNURadio flowgraphs or if you have mismatched rates somewhere).

     

    - Gough

     

    EDIT: Why is your source 32k and the sink running at 64k? Make them both equal would be a good start, but perhaps not necessarily enough as there will still be offset from the PC clock to the SDR's clock to worry about.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago

    Sorry - I only just realised you had an earlier part to the question which I completely glossed over.

     

    I'm not too experienced with GRC flowgraphs, but I suspect the blue-tabs indicate real values. So the signal source is generating a 32ks/s stream of sine real-values into the sink block. As the sink block has it's own frequency, I suspect this means the graph represents a 1kHz signal being generated and shifted up to 433.2MHz centre frequency. This would be a form of modulation - at a guess I would think it to be single sideband (in this case upper-sideband), which means you'll probably find a pure tone at 433.201MHz assuming everything is calibrated. That is, if my understanding is correct - I don't have a HackRF so ... I can't be sure.

     

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • baldengineer
    0 baldengineer over 6 years ago in reply to Gough Lui

    Gough Lui  wrote:

     

    I suspect you have discontinuities in your signal from the hackRF.

    otherwise you might need to look at your signal in the time domain.

    That was my first thought. I have access to an 8 GHz oscilloscope with TDR. I looked at the signal on the scope and it is not stable there either. (Don't have screenshots. They didn't save to my USB drive.) So I looked at the cable with the TDR and it looked fine. Regardless, I switched to a higher quality cable and there was no change on the HackRF's output.

     

    you get a crackle now and then (more often if you're underflowing severely - e.g. in the case of more complex GNURadio flowgraphs or if you have mismatched rates somewhere).

    With a slightly more complex frequency modulated flowgraph, I'm getting audible crackles when transmitting a wav file. On that one, I am seeing "aU" feedback from GNUradio, which I think is buffer underflows. With this simpliified flowgraph, I'm not getting any "aU" feedback from GNURadio.

     

     

    Why is your source 32k and the sink running at 64k?

    Troubleshooting step after I took the spec an screenshot. But admittly, I don't fully understand how sample/data rates work in GNUradio yet.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago in reply to baldengineer

    If you are getting underflows, that's bad news. But even if you don't get the "U" showing up in console, this is not an indication that all is fine. Instead, you could be having overflows elsewhere unreported (e.g. in the driver for the HackRF or the HackRF's FPGA). I would double-check your connectivity as well - in case you get better results from certain USB controllers. I know the BladeRF I had before was very picky -  certain USB ports would always cause discontinuous output depending on the chipset.

     

    If you want a global sample rate (i.e. the samp_rate variable), then set all your blocks sample rates to samp_rate so that you change it in one spot rather than all over the graph. But to have a source block at a different rate to the sink block is always going to cause issues. Also note that not all rates are going to be supported by certain sinks - usually the FPGAs have certain fixed rates they can accept input at (any other rate requires CPU-intensive resampling and is best avoided).

     

    Some documentation for the HackRF claims that it supports rates from 2Msps to 20MSps - so to make it happy, perhaps set sample rate to 2M and see what happens?

     

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • baldengineer
    0 baldengineer over 6 years ago in reply to Gough Lui

    so to make it happy, perhaps set sample rate to 2M and see what happens?

    I'll give that a shot next. I've changed the Hack RF sample rate a number of times, but not systematically. That's a good next step.

     

    then set all your blocks sample rates to samp_rate

    Yeah, that's how I've been using GNURadio. In this case, I just tacked on "*2" on to the variable to double the global sample rate. (I was hoping over sampling would fix the problem.)

     

    I'm at Teardown in Portland right now. Lime Microsystems has a big show of their SDR solutions and there is at least one other talk on SDRs. So between your suggestions and those sessions, I'll be heading back to the lab armed with way more information than I had a day ago.

     

    Thanks Gough.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago in reply to baldengineer

    Best of luck! I've just been too busy to play with SDRs, sadly. But the Lime Microsystems chips have been so important - the BladeRF that I had was using one as the front end and it's been pretty amazing for me (while it lasted).

     

    Glad to see they've entered the market with their own LimeSDR and LimeSDR Mini - I should pick one up next time I get a chance.

     

    - Gough

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube