#!/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"
