Giter VIP home page Giter VIP logo

fm_tune's Introduction

FM_tune

Run with:

./fm_tune <radio freq in MHz>
./fm_tune 101.3

Gives a rough PPM estimation which can be used with something more precise like kalibrate-rtl.

How does it work

  1. Get samples at 1.8Msps at requested freq
  2. Lowpass to isolate one station
  3. FM demod
  4. Decimate to ~50kHz
  5. Bandpass to filter only the FM pilot signal (19kHz)
  6. Adjust the frequency until the pilot signal is centered around 0

Precision

If the FM signal is clear (you can hear the station without static) the measurements should be repeatable to within 1ppm of each run. Radio stations do not necessarily have to keep a stable signal though and some transmitting error is allowed.

General approch: If you can run the check against 3 or more strong stations and get same result, you could assume that's the right PPM. If you have fewer stations or varied results, use the result as an inital value to a more precise app like https://github.com/viraptor/kalibrate-rtl

Build

Dependencies:

  • liquid-dsp
  • SoapySDR

Build with:

make

fm_tune's People

Contributors

snake-4 avatar viraptor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fm_tune's Issues

USRP B210

Hi there!

I am just curious if this could be made to work with a USRP B210 device?

runtime error No devices found

Hi,
I'm running ubuntu 18.04 / kernel 5.4 / both liquid-dsp & SoapySDR installed
I have RTL2832U dongle with Fitipower FC0013 tuner
First cloned your repo and used make (compiled successfully)
But after running fm_tune it says:
No devices found, using stdin
My dongle is connected and rtl_test, GQRX and etc works
Altough to test fm_tune i close every other program related to my rtlsdr dongle, so i'm sure i't available and that's not the case.
Any help would be appreciated.

Makefile doesn't work correctly on macOS 14 with Homebrew

When attempting to build on macOS 14 (Sonoma), the process kept failing because the compiler and linker couldn't find the Liquid-DSP headers or libraries. This was despite having the necessary packages installed (brew install liquid-dsp soapysdr).

The issue appears to be that the Makefile assumes that the paths returned by pkg-config for SoapySDR will also include the Liquid-DSP headers/libraries - but on macOS when using Homebrew, this isn't the case. Instead, the path returned is the specific folder in Homebrew's "Cellar" for SoapySDR (e.g. /opt/homebrew/Cellar/soapysdr/0.8.1_1/lib), which doesn't have anything related to Liquid-DSP for obvious reasons.

To work around this, I manually ran the compilation command (thankfully, there's only one) with the 'generic' Homebrew includes/lib paths (/opt/homebrew/include and /opt/homebrew/lib), which let everything compile happily. Said generic paths are just trees of symlinks to solve for this issue while allowing for multiple versions of a given app/library to be installed, to avoid Dependency Hell and the like.

As to a fix for the Makefile, I'm unsure of the best way, but an easy way would be to:

  1. Test if a system is running a Darwin-based OS using uname
  2. Test if homebrew is installed by running brew --env
  3. If true, set SOAPY_CFLAGS to $HOMEBREW_PREFIX/include and SOAPY_LDFLAGS $HOMEBREW_PREFIX/lib in the Makefile.

In my case - and if anyone having similar issues on macOS runs into this issue - the working build command ended up being:

cc fm_tune.c -std=c99 -O3 -Wall -Wextra -march=native -I/opt/homebrew/include -lliquid -lm -L/opt/homebrew/lib -lSoapySDR -o fm_tune

cant build. SoapySdr not found. Please help

Hi please help me have this error message after compiled the code
I put code into pastebin
For any successfully help im willing to donate to you

pastebin.com/iVQZZdaH

Thanks for help!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.