From owner-freebsd-multimedia Sat Jun 26 14:32:49 1999 Delivered-To: freebsd-multimedia@freebsd.org Received: from orthanc.ab.ca (orthanc.ab.ca [207.167.3.130]) by hub.freebsd.org (Postfix) with ESMTP id C66A414FAE for ; Sat, 26 Jun 1999 14:32:47 -0700 (PDT) (envelope-from lyndon@orthanc.ab.ca) Received: from orthanc.ab.ca (localhost.orthanc.ab.ca [127.0.0.1] (may be forged)) by orthanc.ab.ca (8.9.3/8.9.3) with ESMTP id PAA05313; Sat, 26 Jun 1999 15:32:41 -0600 (MDT) (envelope-from lyndon@orthanc.ab.ca) Message-Id: <199906262132.PAA05313@orthanc.ab.ca> X-Mailer: exmh version 2.0.2 2/24/98 To: Frode Vatvedt Fjeld Cc: freebsd-multimedia@FreeBSD.ORG Subject: Re: bt848 channel frequencies In-reply-to: Your message of "26 Jun 1999 13:55:57 +0200." <2hzp1n9nw2.fsf@dslab7.cs.uit.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 26 Jun 1999 15:32:40 -0600 From: lyndon@orthanc.ab.ca Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > Also, the datatype for 'frequency' should be wide enough for > > satellite and long-wave work, from few kHz to tens of GHz. > > I believe your typical "long" scales to 4.2 GHz if the unit is a > single Hz. Does anyone know of tuning applications that would require > a granularity smaller than one KHz? What about the different radio > bands, for example? For many applications on HF you need to tune with at least 0.1 Hz resolution. For precision applications I would want to be able to resolve to 0.001 Hz or better. Too much resolution in the API is better than not enough. > Or would it be better to use a 64-bit type to represent frequencies? > Then we could go from uHz to GHz without problems.. :-) Why not hide the implementation in the library and just pass the frequency (in around as an ASCII string? E.g. int tuner_set_freq(TUNER *t, char *freq); . . . rc = tuner_set_freq(t, "14313000.155"); /* rc = 0 */ rc = tuner_set_freq(t, "740000"); /* rc = -1, errno = ERANGE (tuner doesn't tune that low) */ rc = tuner_set_freq(t, NULL); /* rc = -1, errno = EFAULT */ Frequency strings are in Hz. If no '.nnn' appended assume '.0'. --lyndon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message