Author Topic: Generating Simultaneous Tones  (Read 14485 times)

0 Members and 1 Guest are viewing this topic.

Offline OldVoltsTopic starter

  • Contributor
  • Posts: 23
  • Country: us
Generating Simultaneous Tones
« on: April 15, 2021, 02:27:22 am »
I’m working on a project that needs to transmit 16 “bits” of information, all 16 “bits” simultaneously. 
Currently using AX.25 but nowhere quick enough; AX.25 overhead is a killer.
Please note: I’m NOT looking for other ways to do this – 16 tones at a time is where we’re going.
Caveats: No operating system(s) – that’s it!
Can use a (reasonable) number of processors (16 is NOT reasonable)
Thoughts?
Experiences?
Thanks!
Bill
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: Generating Simultaneous Tones
« Reply #1 on: April 15, 2021, 03:41:14 am »
One possibility for the transmit end would be 4x four channel DDS chips with pins for external modulation control, e.g. AD9959.  That specific DDS is capable of sinewave output on four independent channels from near DC to tens of MHz with reasonably low waveform distortion, modulated by four profile (control) pins.  You can set up simple two frequency FSK, two level ASK and a variety of other modulation modes directly controlled by parallel data on the profile pins. Once configured, no further CPU intervention would be required.

However I'm fairly sure you wont like the price!

If you want a better answer that doesn't involve selling your firstborn into slavery to fund it, you'll need to give us the frequency range of the tones, and their required purity, and any other constraints on their modulation, + the data rate required (per bit/channel).
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #2 on: April 15, 2021, 04:12:37 am »
Sorry, I'm not familiar with AX.25 and I wasn't able to get my questions about it answered using Google.  I'm guessing that this has something to do with coding digital bits as audio tones.  Do you use a different tone for each of your 16 bit streams?  What about AX.25 is not quick enough???  Maybe more details of your problem and why it is hard to do would be helpful?

It does sound like maybe DDS would do the job for the transmit side.  I've done a fair amount of work with DDS and it's not at all difficult.  If you have a processor that is not heavily loaded it should not require so many MIPS either.  A DDS has a frequency control input which is also called the step size or phase increment register.  This value determines the frequency output.  Then there needs to be a phase accumulator (a counter, but adds the step size rather than just adding one each time).  The phase value in the accumulator increases steadily until it rolls over creating a sawtooth pattern corresponding to the phase of a rotator, 0 to 2pi radian (or 0 to 360 degrees if you prefer).  The phase accumulator value is translated to a sine wave value typically involving a lookup table for the 0:pi/2 range which is used to generate sine values from 0:2pi by inverting the phase input and/or negating the sine value output through the four quadrants.  These values are multiplied by an amplitude coefficient.  The result is a sine wave of very precisely controlled frequency and amplitude. 

Audio sample rates do not typically require much processor time for this, so all 16 sine waves can be generated in the same code run sequentially with 16 different frequency control words.  The values can be added and output to a single DAC to be output to the transmitter. 

Does that make sense?  Am I understanding what you are trying to do, i.e. create 16 separate modems to transmit 16 bit streams in parallel? 

The receiving side is a bit tougher.  That will require filtering to separate the frequencies.  I don't know what frequencies you wish to use, but can be a lot of processing and I expect it will require a DSP... maybe.  The devil is in the details.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 
The following users thanked this post: OldVolts

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Generating Simultaneous Tones
« Reply #3 on: April 15, 2021, 04:29:30 am »
Keyword: OFDM.
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #4 on: April 15, 2021, 04:37:04 am »
Keyword: OFDM.

I've got one word for you Benjamin, Plastics
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Generating Simultaneous Tones
« Reply #5 on: April 15, 2021, 07:49:39 am »
.
« Last Edit: August 19, 2022, 04:22:55 pm by emece67 »
 
The following users thanked this post: cdev

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Generating Simultaneous Tones
« Reply #6 on: April 15, 2021, 08:18:22 am »
So generating 16 tones simulataneously of say less than 3.4KHz?

Essentially you need 16 sine generators with a sample rate of perhaps 8KHz.  Using a LUT (look-up table) based DDS generator with a bit of linear-interpolation.

I've done 192KHz sinewave generation at -130dB distortion on a dsPIC33FJ128GP306 in the past, which would give 24 (192/8) tones with some mods.  So you're well within what can be done on a low end DSP, so something beefier (like the dsPIC33EP series) you could also run an FFT on the same part for receiption/decoding.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #7 on: April 15, 2021, 02:14:47 pm »
The FFT can be a lot of math, but how often you need to do the FFT depends on the data rate on the 16 tones, so it might be feasible on simpler devices.  A lot is missing from this project description, but I suppose you can set an upper limit on the data rate based on the tone separation (channel spacing).  So if 3.4 kHz is indeed the working bandwidth, that gives 212.5 Hz channel spacing.  So maybe 100 bps per channel.  Then a means of synchronizing to the data bits would be needed, so a faster FFT rate may be needed which would require overlapped FFTs.  As long as the FFT length is not too long this may be practical on a simple MCU.

I have not worked with OFDM before, so I don't know the practical details. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Generating Simultaneous Tones
« Reply #8 on: April 15, 2021, 03:16:41 pm »
Goertzel filters were/are used in a DTMF decoders.

DTMF is 8 seperate tones, applied in 16 combinations.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #9 on: April 15, 2021, 03:54:12 pm »
Goertzel filters were/are used in a DTMF decoders.

DTMF is 8 seperate tones, applied in 16 combinations.

I once interviewed with a telecom company where one of the questions asked was how to detect such tones.  I said, "Goertzel" and the interviewer said that was an obsolete method, there are better.  What I thought was strange was that he put so much emphasis on my knowing this up front rather than establishing what I might be able to figure out on the job if given a problem to solve.  I've never been big on memorizing stuff as a definition of my job.  I pride myself on adapting and learning new things.  The board I have in production now uses synthetic impedance generation to make the output look like 50 ohms with a 12.5 ohm resistor giving additional head room.  It took me a while to find a circuit to do this but it made the board practical without dissipating a bunch more heat and not reaching the amplitudes required.  I didn't have a clue this could be done when I started the design. 

In DTMF the difference in amplitude between the two tones is called, "twist".  I've always thought that was a strange term and wondered why this came about.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Generating Simultaneous Tones
« Reply #10 on: April 15, 2021, 04:26:11 pm »
Keyword: OFDM.

I've got one word for you Benjamin, Plastics!

:palm: I was not kidding. In short: using iFFT it is possible to generate multiple tones, depending how you set bins of FFT. Using FFT you "demodulate" it.

Further reading
« Last Edit: April 15, 2021, 04:58:03 pm by ogden »
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #11 on: April 15, 2021, 05:06:44 pm »
Keyword: OFDM.

I've got one word for you Benjamin, Plastics!

:palm: I was not kidding. In short: using iFFT it is possible to generate multiple tones, depending how you set bins of FFT. Using FFT you "demodulate" it.

Further reading

I never thought you were kidding.  You have to say something to make a joke.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Generating Simultaneous Tones
« Reply #12 on: April 15, 2021, 05:13:03 pm »
Keyword: OFDM.

I've got one word for you Benjamin, Plastics!

:palm: I was not kidding. In short: using iFFT it is possible to generate multiple tones, depending how you set bins of FFT. Using FFT you "demodulate" it.

Further reading

I never thought you were kidding.  You have to say something to make a joke.
Single abbreviation was much more relevant than whole sentence of (yours), so stop :horse:, stay on topic please.
 
The following users thanked this post: tooki

Offline OldVoltsTopic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: Generating Simultaneous Tones
« Reply #13 on: April 15, 2021, 07:30:59 pm »
Perhaps some clarification is in order:
1.  Only 1 needed - can be "moderately" expensive (~$200)
2. User end (decoder) is simple Arduino based FFT display.  32 "bins" seems possible.
3.  Tones from 300 - 3000 Hz (audio passband of 220 MHz amateur transceiver) - preferably not harmonically related.
I have an amateur 2M repeater with 7 remote receive sites in addition to the local receiver. 
At the control site I can observe the activity of each remote site - receive or not receive (the first 8 "bits")
I can also watch the voter selected receiver indication (1 "bit" for each receiver but only 1 selected at a time) - the second 8 "bits"
We already take this information and place it into an AX.25 packet and transmit it out at 1200 bps but it can run 1/2 to 3/4 second behind due to packetization and buffering.
This lag prevents the  observation of the system as a whole - in real time - sometimes required to troubleshoot.
It also requires the user to make an investment in obtuse hardware and arcane software - in some cases a full PC or several (3) SOCs. 
One Arduino and a 2 line LCD display is WAY simpler and cheaper.

So far so good - several interesting things to look at more closely.
Bill
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #14 on: April 15, 2021, 09:47:17 pm »
Keyword: OFDM.

I've got one word for you Benjamin, Plastics!

:palm: I was not kidding. In short: using iFFT it is possible to generate multiple tones, depending how you set bins of FFT. Using FFT you "demodulate" it.

Further reading

I never thought you were kidding.  You have to say something to make a joke.
Single abbreviation was much more relevant than whole sentence of (yours), so stop :horse:, stay on topic please.

LoL!  Your initial post had nearly zero information content.  Your second post contained a single comment and griped that I didn't post anything useful which is false.  Why don't you try contributing something rather than arguing about it?  Try explaining how the frequencies would be assigned and how they should relate to the sample rate for optimum isolation of the channels and how fast data might be sent given the constraints of the FFT.  Do you have experience with any of this?
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #15 on: April 15, 2021, 09:54:33 pm »
So maybe you can leave out the irrelevant information and explain what it is you require from the communications channel.  When you talk about voter circuits and arcane software this is information that I can't use for anything. 

Why don't you pick the frequencies and tell us what they should be?  What is the data rate you want to see on the channels? 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4391
  • Country: dk
Re: Generating Simultaneous Tones
« Reply #16 on: April 15, 2021, 10:24:11 pm »
Perhaps some clarification is in order:
1.  Only 1 needed - can be "moderately" expensive (~$200)
2. User end (decoder) is simple Arduino based FFT display.  32 "bins" seems possible.
3.  Tones from 300 - 3000 Hz (audio passband of 220 MHz amateur transceiver) - preferably not harmonically related.
I have an amateur 2M repeater with 7 remote receive sites in addition to the local receiver. 
At the control site I can observe the activity of each remote site - receive or not receive (the first 8 "bits")
I can also watch the voter selected receiver indication (1 "bit" for each receiver but only 1 selected at a time) - the second 8 "bits"
We already take this information and place it into an AX.25 packet and transmit it out at 1200 bps but it can run 1/2 to 3/4 second behind due to packetization and buffering.
This lag prevents the  observation of the system as a whole - in real time - sometimes required to troubleshoot.
It also requires the user to make an investment in obtuse hardware and arcane software - in some cases a full PC or several (3) SOCs. 
One Arduino and a 2 line LCD display is WAY simpler and cheaper.

So far so good - several interesting things to look at more closely.
Bill

16 bits at 1200bps is ~13ms, an arduino should have no problem doing 1200bps


 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Generating Simultaneous Tones
« Reply #17 on: April 15, 2021, 10:53:05 pm »
Why don't you try contributing something rather than arguing about it?
I already contributed by telling that OFDM could be solution. Sorry if you were unable to process that.

Quote
Try explaining how the frequencies would be assigned and how they should relate to the sample rate for optimum isolation of the channels and how fast data might be sent given the constraints of the FFT.  Do you have experience with any of this?
OP/you can start with link I gave. Other useful resource about using OFDM multicarrier communication is https://en.wikipedia.org/wiki/PRIME_(PLC). PRIME-Spec_v1.3.6.pdf to be specific. Obviously basic knowledge of FFT/iFFT will help. Yes, I know enough about subject. No, I won't do any classes here.
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1850
  • Country: us
Re: Generating Simultaneous Tones
« Reply #18 on: April 16, 2021, 12:29:14 am »
It sounds to me that the OP is considering DMT (Discrete Multi Tone), with essentially on/off keying of the individual tones.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline OldVoltsTopic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: Generating Simultaneous Tones
« Reply #19 on: April 16, 2021, 02:01:03 am »
Exactly that.
Thanks!
 

Offline OldVoltsTopic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: Generating Simultaneous Tones
« Reply #20 on: April 16, 2021, 02:15:59 am »
16 bits at 1200bps is ~13ms, an arduino should have no problem doing 1200bps
Unfortunately it's not the "bits" that are the problem with AX.25.
Once the initial connection is established, data is transferred in frames - I (information) frames to be specific.
Fields in a frame:
Flag (8 bits), Address (112 to 560 bits), Control (8 bits), PID (8  bits), Information (our 16 bits), FCS (16 bits), Flag (8 bits) -
Therefore we have to transmit a WHOLE BUNCH more than our 16 bits of data to satisfy the AX.25 protocol requirements.
Oh - and the frame, once received, must be acknowledged back to the sender before the sender will send the next frame.
Sigh - AX.25 was not the best implementation.  Why I'm asking the group mind for ideas.

Thanks,
Bill
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16545
  • Country: us
  • DavidH
Re: Generating Simultaneous Tones
« Reply #21 on: April 16, 2021, 02:19:24 am »
Goertzel filters were/are used in a DTMF decoders.

That is probably the method I was thinking of.  As I recall, the Goertzel method is like a truncated FFT.  Long ago I used it on a PIC to decode DTMF.

In DTMF the difference in amplitude between the two tones is called, "twist".  I've always thought that was a strange term and wondered why this came about.

I thought it was because on an oscilloscope, the two tone combination looks like it "twists".
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1850
  • Country: us
Re: Generating Simultaneous Tones
« Reply #22 on: April 16, 2021, 02:28:37 am »
Then assuming the FM rigs have an audio bandwidth that covers 500Hz to 2500 Hz, you might choose tones starting at 550 Hz with a tone spacing of (say) 125 Hz.  This avoids harmonics of the lower tones (caused by distortion) falling on top of the upper tones -- at least I think it does.  FFT seems to be the way to decode these, and software generation of the tones seems pretty straightforward.  Of course the FFT buckets have to be narrow enough to not include the harmonics that *are* there.  I suppose you could use the same tone generation software to create quadrature tones and make individual tone detectors.  I have no idea if this is easier or harder than the FFT -- never done it myself.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 407
  • Country: us
Re: Generating Simultaneous Tones
« Reply #23 on: April 16, 2021, 03:29:42 am »
Keyword: OFDM.

I second the OFDM suggestion. I'd done RF hardware for many years and had done a fair amount of baseband work for Tx, but never Rx. With OFDM I was able to code a receiver. It's pretty slick. You use training symbols which allow you to do frequency correction and equalizattion. It seems exactly what you are asking for.
 
The following users thanked this post: OldVolts

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: pr
Re: Generating Simultaneous Tones
« Reply #24 on: April 16, 2021, 03:57:20 am »
Then assuming the FM rigs have an audio bandwidth that covers 500Hz to 2500 Hz, you might choose tones starting at 550 Hz with a tone spacing of (say) 125 Hz.  This avoids harmonics of the lower tones (caused by distortion) falling on top of the upper tones -- at least I think it does.  FFT seems to be the way to decode these, and software generation of the tones seems pretty straightforward.  Of course the FFT buckets have to be narrow enough to not include the harmonics that *are* there.  I suppose you could use the same tone generation software to create quadrature tones and make individual tone detectors.  I have no idea if this is easier or harder than the FFT -- never done it myself.

The problem with the narrow spacing of tones is it requires a longer FFT to resolve them.  That implies a slower bit rate.  Why is it good to limit the low end of the frequency range so much?  If your tone spacing is 125 Hz, there's no reason in the processing to not use down to say, 200 Hz to allow a bit wider spacing.  Is there something about the RF gear that limits the low end range?  The OP is pretty stuck in seeing his original problem that he is having trouble explaining the requirements for the solution.  I don't think any references to AX.25 add anything to understanding the problem.  I'd love to see a simple statement of what is to be achieved with data rates and other requirements. 

The FFT is exactly the same as multiplying the input by a number of quadrature tones, i.e. a DFT.  Cooley and Tukey just found a clever way to take advantage of symmetries in the sine function to reduce the number of multiply operations.  Seems Gauss had actually discovered this 160 years earlier, but it had been forgotten by the people who could use it in the 1960s.  Hmmmm...

That actually made me realize this is one of those times when the FFT may be less efficient than the DFT.  The FFT is O(n log2(n)).  The DFT is O(n) for any bin and the max bins are O(n).  But in this case only 16 bins are needed.  So if the FFT size is large enough, it would be faster to calculate the specific bins needed in the DFT.  The cross over point would be at length 2^16 times some constant.  The constant would be approximately 0.5 since the FFT butterfly has two complex multiplies and two adds while the DFT unit is one of each.  Even so, the crossover would be about 32K data points which is far more than needed, so the FFT would still be faster.  Did I do that right?
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf