Monday, March 22, 2010

Updated script for DFM offset

I have updated the script to calculate the offset for a reciever or transmitter, taking the frequency directly from the local oscillator results in a mix of the tuned frequency and the offset frequency that gives us the Intermidiate frequency. we need to add this off set to a frequency that we want to tune to.

So for instance if you want to tune to 531khz a broadcast frequency in the AM band you would need to add the offset (in my case 455khz) to the required frequency, now you tune the radio watching the DFM until it reaches in my case 986khz (531+455).

If you have tuned in to a station and dont know the frequency you take the displayed frequency on the DFM and subtract the offset to give you the actual tuned frequency.

The script takes your entered values and displays both the minus and plus offsets and then starts again, use ctrl c to exit the script as it just runs in an infinate loop.




#!/bin/bash

# Filename:- dfm.sh Ver:- 0.0.1.2 
# Copyleft 2010 Mark (Hiddensoul) Clohesy
# shed.twistedsouls.com
#
# Linux Bash Script to add and subtract a given offset (OFFST) 
# from an entered number, it is used to calculate the frequency
# of a radio reciever or transmitter by adding or subtracting
# the offset of the local oscillator. ctrl c to exit       
#
OFFST=455
#
for ((;;))
do
        echo -n "Please enter Valus to offset in Khz:-"
        read -e KHZ
        MKHZ=$(($KHZ - OFFST))
        AKHZ=$(($KHZ + OFFST))
        echo;echo -n "Minus Offset Frequency:-" $MKHZ "-Khz"
        echo;echo -n "     Entered Frequency:-" $KHZ "-Khz"
        echo;echo -n " Plus Offset Frequency:-" $AKHZ "-Khz"
        echo 
done
#
#EOF

No comments:

Post a Comment