Commit 62af4949 authored by John Robert Gill's avatar John Robert Gill

Added helper conversion functions for ftw <--> freq.

parent 9c542be8
#!/bin/bash
freq=$1
sps_h=4620
freq_h1=`echo "$freq/$sps_h" | bc -q`
freq_wrclk=125000000
prod=`echo "$freq_h1*(2^48)" | bc -q`
ftw=`echo "$prod/$freq_wrclk" | bc -q`
ftw_hex=`echo "obase=16;ibase=10; $ftw" | bc -q`
echo "RF Input frequency($freq Hz) has an FTW=0x$ftw_hex"
......@@ -4,9 +4,9 @@ ftw_hex=`echo $1 | tr a-f A-F`
freq_wrclk=125000000
ftw=`echo "ibase=16; $ftw_hex" | bc -q`
echo "ftw=$ftw"
#echo "ftw=$ftw"
prod=`echo "$ftw*$freq_wrclk" | bc -q`
echo "prod=$prod"
#echo "prod=$prod"
fout=`echo "$prod/(2^48)" | bc -q`
echo "Fout=$fout"
fout_rf=`echo "$fout*4620" | bc -q`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment