<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoPlainText">Scotty - thanks for the further explanation. With that in mind, I'd like to discuss exactly how to design the "CH" command (configure channel) so that we could put the DE into that mode.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">As a first pass at this, I have designed a buffer layout like so:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">struct channelBlock</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    {</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    int channelNo;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    int antennaPort;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    double channelFreq;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    double channelBandwidth;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    };</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">typedef struct channelBuf</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    {</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    char chCommand[2];</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    struct channelBlock channelDef[16];</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Courier New"">    } CHANNELBUF;</span><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Let’s say we want to collect data at 2.5 MHZ and 5.0 MHz, observing 5 Hz on either side of carrier on both channels (as you say in your example).<o:p></o:p></p>
<p class="MsoPlainText">An example channel setup request might look like so (illustration below does not show actual layout of the bytes. Values with E are double precision floating point) -<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">CH   0   0    2.5E00     1.0E-02     1  0   5.0E00    1.0E-02<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">This represents:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Channel 0 is on Antenna Port 0, and has a center frequency of 2.5  (MHz) and a bandwidth of 0.01 (kHz)(i.e., 10 Hz)<o:p></o:p></p>
<p class="MsoPlainText">Channel 1 is on Antenna Port 0, and has a center frequency of 5.0 (MHz) and a bandwidth of 0.01 (kHz)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I am not sure this contains everything you need for the configuration because it doesn’t give a hint on how to decimate the data or set the samples per second. How would we specify that?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-73- Bill Engelke<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">P.S. - (BTW, we would actually need 1,024 samples to approach this, as the number of bins must be a power of 2).<o:p></o:p></p>
<p class="MsoPlainText">P.P.S. – We still need to get the science guys to weigh in on whether a snapshot of the bands every ~100 seconds is fast enough in snapshotter mode.  As far as the number of channels, we need to shoot for being able to collect data on
 WWV at 2.5, 5.0, 10.0, 15.0 and 20.0 MHz as well as CHU at 3.33, 7.335, and 14.670 MHz (that’s 8 carrier frequencies), at the same time as collecting FT8 on 6 to 8 bands; and possibly also WSPR on another 6 – 8 bands. This may be aspirational, I know….<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: Scotty Cowling <scotty@tonks.com> <br>
Sent: Tuesday, April 14, 2020 5:16 PM<br>
To: Engelke, Bill <bill.engelke@ua.edu>; Tom McDermott <tom.n5eg@gmail.com><br>
Cc: TAPR TangerineSDR Modular Software Defined Radio <tangerinesdr@lists.tapr.org>; Dr. Nathaniel A. Frissell Ph.D. <nathaniel.frissell@scranton.edu><br>
Subject: Re: [TangerineSDR] Question on bandwidth versus sample rate: can they be independently set?</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Hi Bill,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">To answer your first questions first...<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The reason that we have to run multiple channels at the same sample rate is due to the fact that we are interleaving multiple virtual receivers'
<o:p></o:p></p>
<p class="MsoPlainText">data in the same packet. Although theoretically we *could* interleave them at different rates, Digital RF would probably not like it.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">However, we have the capability to create multiple single-receiver data streams (maybe not in phase 1), and these would not have to be related in any way (sample rate or bandwidth).<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The frequency precision or resolution bandwidth is related to the number of bins and the time interval. If you want 10 milli-hertz resolution, you must sample for 100 seconds (1/0.010Hz=100sec). The sample rate will determine the length
 your FFT needs to be. If you are over-sampling at 122.88Msps and want 10 milli-Hertz resolution bandwidth, you must still sample for 100 seconds. Thus you would need an FFT of length 100*122.88*10^6, which is kind of long. :-) Of course, you would get<o:p></o:p></p>
<p class="MsoPlainText">12,288,000,000 bins, each 10milli-Hz wide. You would then use the 10 or<o:p></o:p></p>
<p class="MsoPlainText">20 bins centered on 2.5MHz to determine WWV's doppler shift, throwing away the other 12,287,999,980 frequency bins<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">It makes more sense to filter and decimate to something more reasonable, like 10sps (+/- 5Hz) and do an FFT of length 1000 to get 1000 bins of 10 milli-Hz each. Especially since filtering to a 5Hz bandwidth without decimating is exceptionally
 hard. Reducing the bandwidth with combined filtering and decimation is a common technique for DSP, which may be why you often see sample rates and filter bandwidths track.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Think of it this way. If I give you 48ksps sample rate, do you really want more than 48kHz of bandwidth? Anything above 48kHz of bandwidth will alias back into your baseband. I could give you less (say 24kHz), but then why not reduce
 the sample rate to 24kHz and reduce the load on your DSP code running on the PC/SBC?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">So to answer your first question, yes, we can arrange it so the you can independently set the sample rate and bandwidth, but I don't see much reason to do it, and in extreme cases it makes the filtering difficult inside the FPGA.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">To answer your second question, yes, the way Tom describes it is exactly how the FPGA will process the raw data before sending it to you.  All we have to do is to make sure that we support the sampling rates that you require. If you
 need +/- 5Hz, then we will do it. In many ways, lower sampling rates are easier to implement. They certainly take up less bandwidth on the wire than sending over full bandwidth data. :-)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">9 virtual receivers at 10sps won't take up very much bandwidth. Even a RPi might be able to do 9 FFTs of 1024 samples each in a reasonable amount of time. If not, then maybe you would have to develop the algorithm to do the calculations
 in the time domain.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Hope that this makes some sense, along with Tom's excellent explanation.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">73,<o:p></o:p></p>
<p class="MsoPlainText">Scotty WA2DFI<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">On 4/14/2020 12:50 PM, Engelke, Bill wrote:<o:p></o:p></p>
<p class="MsoPlainText">> Tom – thanks for the analysis on that.  (I must admit, I will have to
<o:p></o:p></p>
<p class="MsoPlainText">> study this a bit to really grasp it)… But now, let me pose a couple of
<o:p></o:p></p>
<p class="MsoPlainText">> questions for Scotty & Nathaniel –<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">>    *   Scotty – could we enable the DE to be able to do what Tom describes below?<o:p></o:p></p>
<p class="MsoPlainText">>    *   Nathaniel – regarding the precision & sample rate – for science results, is this the right trade-off between precision and how often we get a sample?  Or is there another, better way to do it?<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> -73- Bill, AB4EJ<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> From: Tom McDermott <<a href="mailto:tom.n5eg@gmail.com"><span style="color:windowtext;text-decoration:none">tom.n5eg@gmail.com</span></a>><o:p></o:p></p>
<p class="MsoPlainText">> Sent: Tuesday, April 14, 2020 1:27 PM<o:p></o:p></p>
<p class="MsoPlainText">> To: TAPR TangerineSDR Modular Software Defined Radio <o:p>
</o:p></p>
<p class="MsoPlainText">> <<a href="mailto:tangerinesdr@lists.tapr.org"><span style="color:windowtext;text-decoration:none">tangerinesdr@lists.tapr.org</span></a>><o:p></o:p></p>
<p class="MsoPlainText">> Cc: Engelke, Bill <<a href="mailto:bill.engelke@ua.edu"><span style="color:windowtext;text-decoration:none">bill.engelke@ua.edu</span></a>><o:p></o:p></p>
<p class="MsoPlainText">> Subject: Re: [TangerineSDR] Question on bandwidth versus sample rate: can they be independently set?<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> Hi Bill - generally the bandwidth and sample rate are locked together. 
<o:p></o:p></p>
<p class="MsoPlainText">> The Nyquist criteria is that the sample rate be at least twice the
<o:p></o:p></p>
<p class="MsoPlainText">> highest frequency component.  When using I+Q samples, we are able to distinguish negative from positive frequencies, so the range of usable frequencies goes from<o:p></o:p></p>
<p class="MsoPlainText">>   -fsamp/2 to +fsamp/2.    Nyquist means that in theory no information is discarded at lower than half the sample<o:p></o:p></p>
<p class="MsoPlainText">> rate ** - even very fractional Hertz stuff is in there and can be recovered, but it might take a long time.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> As an example:<o:p></o:p></p>
<p class="MsoPlainText">> In order to receive a 10 Hertz wide spectrum slice (+/- 5 Hz) the
<o:p></o:p></p>
<p class="MsoPlainText">> receiver would need to first lowpass filter the signal to < 5 Hz. (i.e. from -5 to +5) then decimate and change the sample rate, then send those to you.<o:p></o:p></p>
<p class="MsoPlainText">> You could then for example implement a Complex FFT of size=1024.  This would yield bin sizes of<o:p></o:p></p>
<p class="MsoPlainText">> 10 / 1024,  or 9.8 milliHertz.   Beware however that at a 10 Hz sample rate, that FFT process needs 102.4 seconds worth<o:p></o:p></p>
<p class="MsoPlainText">> of data per FFT.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> Does this clarify?<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> -- Tom, N5EG<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> ** Except that due to imperfect LPF filter roll-off, ADC quantization, etc.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> On Tue, Apr 14, 2020 at 10:17 AM Engelke, Bill via TangerineSDR <<a href="mailto:tangerinesdr@lists.tapr.org%3cmailto:tangerinesdr@lists.tapr.org"><span style="color:windowtext;text-decoration:none">tangerinesdr@lists.tapr.org<mailto:tangerinesdr@lists.tapr.org</span></a>>>
 wrote:<o:p></o:p></p>
<p class="MsoPlainText">> This question is sort of directed to Scotty, but I am posting it here because I’m sure others will have useful thoughts on this matter.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> As you may recall, in TangerineSDR when we collect IQ data for multiple channels, we have to run them all at the same sample rate (at least, for Phase 1). The main reason for this is that Digital RF is optimized for handling data that
 way, and we need to roll with that rather than struggle against it, so that we can have something ready and tested in the time frame. We can add more complexity later if we want.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> I am puzzling over something, however – probably because I still have a lot to learn about digital signal processing.  The frequency precision of an FFT is related to the number of bins (i.e., when I do the FFT with 2048 samples, I
 get more precision than if I do it with 1024 samples). In several conversations, the sample rate and the bandwidth have been almost interchangeable; however, is that mandatory?<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> Specifically, let’s say that I want to closely watch the carrier frequency of WWV at 10 MHz.   We know that the most it moves due to doppler shift is a fraction of a Hz, so I only want to handle a few Hz of bandwidth – but I want to
 do it to a precision of 0.01 Hz.  This precision would seem to dictate a very high sample rate, but the bandwidth I want to process is only 2 to 3 Hz.<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> The QUESTION then is this:  when configuring the channels for the DE to run, is it feasible for me to be able to independently set the sample rate and bandwidth?   If so, is there a major downside to doing this?<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> -73- Bill AB4EJ<o:p></o:p></p>
<p class="MsoPlainText">> --<o:p></o:p></p>
<p class="MsoPlainText">> TangerineSDR mailing list<o:p></o:p></p>
<p class="MsoPlainText">> <a href="mailto:TangerineSDR@lists.tapr.org%3cmailto:TangerineSDR@lists.tapr.org">
<span style="color:windowtext;text-decoration:none">TangerineSDR@lists.tapr.org<mailto:TangerineSDR@lists.tapr.org</span></a>><o:p></o:p></p>
<p class="MsoPlainText">> <a href="http://lists.tapr.org/mailman/listinfo/tangerinesdr_lists.tapr.org">
<span style="color:windowtext;text-decoration:none">http://lists.tapr.org/mailman/listinfo/tangerinesdr_lists.tapr.org</span></a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
</body>
</html>