FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2005, 02:21 AM
dave
Guest
 
Posts: n/a
Default Waveform (de)mixing

I have a really simple problem to solve, name the appropriate algorithm.

1)

I want to mix 24 raw audio waveforms. The present simplistic summing
algorithm doesn't manage the amplitudes correctly.

What, if any, are the modern algorithms for digitally mixing waveforms.

2)

What algorithms would I use to allow one waveform to oscillate another
and to extract one waveform from another. Ie: When an audio signal
oscillates a radio waveform for FM broadcast and when an FM receiver
removes the FM content from a waveform to reveal the audio again.

Any pointers, websites, books that can help?
Reply With Quote
  #2 (permalink)  
Old 03-20-2005, 05:17 AM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

dave wrote:
> I have a really simple problem to solve, name the appropriate algorithm.
>
> 1)
>
> I want to mix 24 raw audio waveforms. The present simplistic summing
> algorithm doesn't manage the amplitudes correctly.


Why not? What's the problem?

> What, if any, are the modern algorithms for digitally mixing waveforms.


Addition, possibly with scaling, rounding, and dithering.

> 2)
>
> What algorithms would I use to allow one waveform to oscillate another
> and to extract one waveform from another. Ie: When an audio signal
> oscillates a radio waveform for FM broadcast and when an FM receiver
> removes the FM content from a waveform to reveal the audio again.


It appears that when you write "oscillate" you mean "modulate". By
extension, I can guess that you mean demodulate (detect) when you write
"extract".

> Any pointers, websites, books that can help?


Clarify your statement of the problem. A sensible recommendation is hard
to when there are too many possibilities.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #3 (permalink)  
Old 03-20-2005, 06:02 AM
Erik de Castro Lopo
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

dave wrote:
>
> I have a really simple problem to solve, name the appropriate algorithm.
>
> 1)
>
> I want to mix 24 raw audio waveforms. The present simplistic summing
> algorithm doesn't manage the amplitudes correctly.
>
> What, if any, are the modern algorithms for digitally mixing waveforms.


For absolute safety when mixing N channels, multiply each channel by
1/N.

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo [email protected] (Yes it's valid)
+-----------------------------------------------------------+
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, you blow away your whole leg!"
-- Bjarne Stroustrup
Reply With Quote
  #4 (permalink)  
Old 03-20-2005, 03:02 PM
dave
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

Erik de Castro Lopo wrote:
> dave wrote:
>
>>I have a really simple problem to solve, name the appropriate algorithm.
>>
>>1)
>>
>>I want to mix 24 raw audio waveforms. The present simplistic summing
>>algorithm doesn't manage the amplitudes correctly.
>>
>>What, if any, are the modern algorithms for digitally mixing waveforms.

>
>
> For absolute safety when mixing N channels, multiply each channel by
> 1/N.
>
> Erik


Fixed it. Thanks for the reply.
Reply With Quote
  #5 (permalink)  
Old 03-20-2005, 03:43 PM
dave
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

Jerry Avins wrote:
> dave wrote:
>
>> I have a really simple problem to solve, name the appropriate algorithm.
>>
>> 1)
>>
>> I want to mix 24 raw audio waveforms. The present simplistic summing
>> algorithm doesn't manage the amplitudes correctly.

>
>
> Why not? What's the problem?
>

Don't worry, fixed it. Thanks for the reply.

>> What, if any, are the modern algorithms for digitally mixing waveforms.

>
>
> Addition, possibly with scaling, rounding, and dithering.
>
>> 2)
>>
>> What algorithms would I use to allow one waveform to oscillate another
>> and to extract one waveform from another. Ie: When an audio signal
>> oscillates a radio waveform for FM broadcast and when an FM receiver
>> removes the FM content from a waveform to reveal the audio again.

>
>
> It appears that when you write "oscillate" you mean "modulate". By
> extension, I can guess that you mean demodulate (detect) when you write
> "extract".
>
>> Any pointers, websites, books that can help?

>
>
> Clarify your statement of the problem. A sensible recommendation is hard
> to when there are too many possibilities.
>
> Jerry


Can any members of this newsgroup recommend websites, books, e-documents
etc that would detail numerical method(s) to assist in performing the
following:

----------------

2a) create two functions e "encode" and d "decode" each with three
waveform parameters w1 "carrier", w2 "audio" and w3 "signal"; such that:

w3 = func e( w1, w2)
w2 = func d( w3, w1)
assuming also that w1 = func d( w3, w2)

eg. if w1 = 100Khz sine and w2 = 10Khz sine then

func e( 100000, 10000) would result in w3 = 110000 sine

and

func d( 110000, 100000) would result in w2 = 10000 sine.

Note: for func e that w3 must equal w1 modulated by w2. Further that for
func d, w2 must equal w3 demodulated by w2.

----------------
Reply With Quote
  #6 (permalink)  
Old 03-20-2005, 05:10 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

dave wrote:
> Jerry Avins wrote:
>
>> dave wrote:
>>
>>> I have a really simple problem to solve, name the appropriate algorithm.
>>>
>>> 1)
>>>
>>> I want to mix 24 raw audio waveforms. The present simplistic summing
>>> algorithm doesn't manage the amplitudes correctly.

>>
>>
>>
>> Why not? What's the problem?
>>

> Don't worry, fixed it. Thanks for the reply.
>
>>> What, if any, are the modern algorithms for digitally mixing waveforms.

>>
>>
>>
>> Addition, possibly with scaling, rounding, and dithering.
>>
>>> 2)
>>>
>>> What algorithms would I use to allow one waveform to oscillate
>>> another and to extract one waveform from another. Ie: When an audio
>>> signal oscillates a radio waveform for FM broadcast and when an FM
>>> receiver removes the FM content from a waveform to reveal the audio
>>> again.

>>
>>
>>
>> It appears that when you write "oscillate" you mean "modulate". By
>> extension, I can guess that you mean demodulate (detect) when you
>> write "extract".
>>
>>> Any pointers, websites, books that can help?

>>
>>
>>
>> Clarify your statement of the problem. A sensible recommendation is
>> hard to when there are too many possibilities.
>>
>> Jerry

>
>
> Can any members of this newsgroup recommend websites, books, e-documents
> etc that would detail numerical method(s) to assist in performing the
> following:
>
> ----------------
>
> 2a) create two functions e "encode" and d "decode" each with three
> waveform parameters w1 "carrier", w2 "audio" and w3 "signal"; such that:
>
> w3 = func e( w1, w2)
> w2 = func d( w3, w1)
> assuming also that w1 = func d( w3, w2)
>
> eg. if w1 = 100Khz sine and w2 = 10Khz sine then
>
> func e( 100000, 10000) would result in w3 = 110000 sine
>
> and
>
> func d( 110000, 100000) would result in w2 = 10000 sine.
>
> Note: for func e that w3 must equal w1 modulated by w2. Further that for
> func d, w2 must equal w3 demodulated by w2.


"func e( 100000, 10000) would result in w3 = 110000 sine" implies
single-sideband suppressed-carrier modulation, abbreviated SSSC. There's
a good explanation on a beginning level in the ARRL Handbook*. There's a
brief description at http://webclass.lakeland.cc.il.us/mbeavers/SSB.html
Ordinary amplitude modulation (AM) is much simpler to do and the result
is easier to demodulate. With your example, it would produce frequencies
at 90, 100, and 110 KHz.

Jerry
_________________________________
* American Radio Relay League. http://www.arrl.org/catalog/?item=9280
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #7 (permalink)  
Old 03-20-2005, 05:26 PM
Ben Bradley
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

On Sun, 20 Mar 2005 14:43:41 +0000, dave <[email protected]> wrote:

>Jerry Avins wrote:
>> dave wrote:
>>
>>> I have a really simple problem to solve, name the appropriate algorithm.
>>>
>>> 1)
>>>
>>> I want to mix 24 raw audio waveforms. The present simplistic summing
>>> algorithm doesn't manage the amplitudes correctly.

>>
>>
>> Why not? What's the problem?
>>

>Don't worry, fixed it. Thanks for the reply.


Care to tell us what the problem was? (this is one of the more
frustrating things you can post to Usenet, you ask a question without
giving enough info, you get responses, then you just say "Never mind,
I fixed it.") Scaling? Are you doing this in fixed point or floating
point?

Try reading the 'more bits please', 'dither' and perhaps a few
others of the articles at http://www.digido.com These are aimed at
getting the best possible sound for high-end recording, but they are
also applicable for getting near-theoretical (or
better-than-theoretical, depending on what theory you apply)
performance from smaller, 4-bit, 8-bit or 16-bit systems.


>>> What, if any, are the modern algorithms for digitally mixing waveforms.

>>
>>
>> Addition, possibly with scaling, rounding, and dithering.
>>
>>> 2)
>>>
>>> What algorithms would I use to allow one waveform to oscillate another
>>> and to extract one waveform from another. Ie: When an audio signal
>>> oscillates a radio waveform for FM broadcast and when an FM receiver
>>> removes the FM content from a waveform to reveal the audio again.

>>
>>
>> It appears that when you write "oscillate" you mean "modulate". By
>> extension, I can guess that you mean demodulate (detect) when you write
>> "extract".


FM modulation is (relatively) easy, presuming you're generating the
carrier using a phase accumulator with a sine function or (more
likely) lookup table. For this purpose I'm presuming both the carrier
and modulation signals are sine waves generated in software. The
function for each output sample is:

modulating_signal = sin (modulating_phase)
modulating_phase += modulating_frequency

sample = sin (carrier_phase + (modulating_signal * modulation_depth))
carrier_phase += carrier_frequency

I did this many years ago to generate FM-type musical sounds (as
from the Yamaha DX-7 synthesizer, very popular at the time) on a
Macintosh.

FM demodulation in software is a bit more complex, I've never done
it or given it any thought, but a near-worst-case that comes to mind
is simulating a ratio detector. There's also PLL which may be more
appropriate.

>>
>>> Any pointers, websites, books that can help?

>>
>>
>> Clarify your statement of the problem. A sensible recommendation is hard
>> to when there are too many possibilities.
>>
>> Jerry

>
>Can any members of this newsgroup recommend websites, books, e-documents
>etc that would detail numerical method(s) to assist in performing the
>following:
>
>----------------
>
>2a) create two functions e "encode" and d "decode" each with three
>waveform parameters w1 "carrier", w2 "audio" and w3 "signal"; such that:
>
>w3 = func e( w1, w2)
>w2 = func d( w3, w1)
>assuming also that w1 = func d( w3, w2)
>
>eg. if w1 = 100Khz sine and w2 = 10Khz sine then
>
>func e( 100000, 10000) would result in w3 = 110000 sine
>
>and
>
>func d( 110000, 100000) would result in w2 = 10000 sine.
>
>Note: for func e that w3 must equal w1 modulated by w2. Further that for
>func d, w2 must equal w3 demodulated by w2.
>
>----------------


-----
http://mindspring.com/~benbradley
Reply With Quote
  #8 (permalink)  
Old 03-20-2005, 06:18 PM
dave
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

Thank you. Reading that website now. No algorithms, but helpful none the
less.

Jerry Avins wrote:
> dave wrote:
>
>> Jerry Avins wrote:
>>
>>> dave wrote:
>>>
>>>> I have a really simple problem to solve, name the appropriate
>>>> algorithm.
>>>>
>>>> 1)
>>>>
>>>> I want to mix 24 raw audio waveforms. The present simplistic summing
>>>> algorithm doesn't manage the amplitudes correctly.
>>>
>>>
>>>
>>>
>>> Why not? What's the problem?
>>>

>> Don't worry, fixed it. Thanks for the reply.
>>
>>>> What, if any, are the modern algorithms for digitally mixing waveforms.
>>>
>>>
>>>
>>>
>>> Addition, possibly with scaling, rounding, and dithering.
>>>
>>>> 2)
>>>>
>>>> What algorithms would I use to allow one waveform to oscillate
>>>> another and to extract one waveform from another. Ie: When an audio
>>>> signal oscillates a radio waveform for FM broadcast and when an FM
>>>> receiver removes the FM content from a waveform to reveal the audio
>>>> again.
>>>
>>>
>>>
>>>
>>> It appears that when you write "oscillate" you mean "modulate". By
>>> extension, I can guess that you mean demodulate (detect) when you
>>> write "extract".
>>>
>>>> Any pointers, websites, books that can help?
>>>
>>>
>>>
>>>
>>> Clarify your statement of the problem. A sensible recommendation is
>>> hard to when there are too many possibilities.
>>>
>>> Jerry

>>
>>
>>
>> Can any members of this newsgroup recommend websites, books,
>> e-documents etc that would detail numerical method(s) to assist in
>> performing the following:
>>
>> ----------------
>>
>> 2a) create two functions e "encode" and d "decode" each with three
>> waveform parameters w1 "carrier", w2 "audio" and w3 "signal"; such that:
>>
>> w3 = func e( w1, w2)
>> w2 = func d( w3, w1)
>> assuming also that w1 = func d( w3, w2)
>>
>> eg. if w1 = 100Khz sine and w2 = 10Khz sine then
>>
>> func e( 100000, 10000) would result in w3 = 110000 sine
>>
>> and
>>
>> func d( 110000, 100000) would result in w2 = 10000 sine.
>>
>> Note: for func e that w3 must equal w1 modulated by w2. Further that
>> for func d, w2 must equal w3 demodulated by w2.

>
>
> "func e( 100000, 10000) would result in w3 = 110000 sine" implies
> single-sideband suppressed-carrier modulation, abbreviated SSSC. There's
> a good explanation on a beginning level in the ARRL Handbook*. There's a
> brief description at http://webclass.lakeland.cc.il.us/mbeavers/SSB.html
> Ordinary amplitude modulation (AM) is much simpler to do and the result
> is easier to demodulate. With your example, it would produce frequencies
> at 90, 100, and 110 KHz.
>
> Jerry
> _________________________________
> * American Radio Relay League. http://www.arrl.org/catalog/?item=9280

Reply With Quote
  #9 (permalink)  
Old 03-20-2005, 06:28 PM
dave
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing

Thanks.

Ben Bradley wrote:
> On Sun, 20 Mar 2005 14:43:41 +0000, dave <[email protected]> wrote:
>
>
>>Jerry Avins wrote:
>>
>>>dave wrote:
>>>
>>>
>>>>I have a really simple problem to solve, name the appropriate algorithm.
>>>>
>>>>1)
>>>>
>>>>I want to mix 24 raw audio waveforms. The present simplistic summing
>>>>algorithm doesn't manage the amplitudes correctly.
>>>
>>>
>>>Why not? What's the problem?
>>>

>>
>>Don't worry, fixed it. Thanks for the reply.

>
>
> Care to tell us what the problem was? (this is one of the more
> frustrating things you can post to Usenet, you ask a question without
> giving enough info, you get responses, then you just say "Never mind,
> I fixed it.") Scaling? Are you doing this in fixed point or floating
> point?
>
> Try reading the 'more bits please', 'dither' and perhaps a few
> others of the articles at http://www.digido.com These are aimed at
> getting the best possible sound for high-end recording, but they are
> also applicable for getting near-theoretical (or
> better-than-theoretical, depending on what theory you apply)
> performance from smaller, 4-bit, 8-bit or 16-bit systems.
>
>
>
>>>>What, if any, are the modern algorithms for digitally mixing waveforms.
>>>
>>>
>>>Addition, possibly with scaling, rounding, and dithering.
>>>
>>>
>>>>2)
>>>>
>>>>What algorithms would I use to allow one waveform to oscillate another
>>>>and to extract one waveform from another. Ie: When an audio signal
>>>>oscillates a radio waveform for FM broadcast and when an FM receiver
>>>>removes the FM content from a waveform to reveal the audio again.
>>>
>>>
>>>It appears that when you write "oscillate" you mean "modulate". By
>>>extension, I can guess that you mean demodulate (detect) when you write
>>>"extract".

>
>
> FM modulation is (relatively) easy, presuming you're generating the
> carrier using a phase accumulator with a sine function or (more
> likely) lookup table. For this purpose I'm presuming both the carrier
> and modulation signals are sine waves generated in software. The
> function for each output sample is:
>
> modulating_signal = sin (modulating_phase)
> modulating_phase += modulating_frequency
>
> sample = sin (carrier_phase + (modulating_signal * modulation_depth))
> carrier_phase += carrier_frequency
>
> I did this many years ago to generate FM-type musical sounds (as
> from the Yamaha DX-7 synthesizer, very popular at the time) on a
> Macintosh.
>
> FM demodulation in software is a bit more complex, I've never done
> it or given it any thought, but a near-worst-case that comes to mind
> is simulating a ratio detector. There's also PLL which may be more
> appropriate.
>
>
>>>>Any pointers, websites, books that can help?
>>>
>>>
>>>Clarify your statement of the problem. A sensible recommendation is hard
>>>to when there are too many possibilities.
>>>
>>>Jerry

>>
>>Can any members of this newsgroup recommend websites, books, e-documents
>>etc that would detail numerical method(s) to assist in performing the
>>following:
>>
>>----------------
>>
>>2a) create two functions e "encode" and d "decode" each with three
>>waveform parameters w1 "carrier", w2 "audio" and w3 "signal"; such that:
>>
>>w3 = func e( w1, w2)
>>w2 = func d( w3, w1)
>>assuming also that w1 = func d( w3, w2)
>>
>>eg. if w1 = 100Khz sine and w2 = 10Khz sine then
>>
>>func e( 100000, 10000) would result in w3 = 110000 sine
>>
>>and
>>
>>func d( 110000, 100000) would result in w2 = 10000 sine.
>>
>>Note: for func e that w3 must equal w1 modulated by w2. Further that for
>>func d, w2 must equal w3 demodulated by w2.
>>
>>----------------

>
>
> -----
> http://mindspring.com/~benbradle

Reply With Quote
  #10 (permalink)  
Old 03-24-2005, 01:02 PM
[email protected]
Guest
 
Posts: n/a
Default Re: Waveform (de)mixing


dave wrote:
> Jerry Avins wrote:
> > dave wrote:
> >
> >> I have a really simple problem to solve, name the appropriate

algorithm.
> >>
> >> 1)
> >>
> >> I want to mix 24 raw audio waveforms. The present simplistic

summing
> >> algorithm doesn't manage the amplitudes correctly.

> >
> >
> > Why not? What's the problem?
> >

> Don't worry, fixed it. Thanks for the reply.
>
> >> What, if any, are the modern algorithms for digitally mixing

waveforms.
> >
> >
> > Addition, possibly with scaling, rounding, and dithering.
> >
> >> 2)
> >>
> >> What algorithms would I use to allow one waveform to oscillate

another
> >> and to extract one waveform from another. Ie: When an audio signal


> >> oscillates a radio waveform for FM broadcast and when an FM

receiver
> >> removes the FM content from a waveform to reveal the audio again.

> >
> >
> > It appears that when you write "oscillate" you mean "modulate". By
> > extension, I can guess that you mean demodulate (detect) when you

write
> > "extract".
> >
> >> Any pointers, websites, books that can help?

> >
> >
> > Clarify your statement of the problem. A sensible recommendation is

hard
> > to when there are too many possibilities.
> >
> > Jerry

>
> Can any members of this newsgroup recommend websites, books,

e-documents
> etc that would detail numerical method(s) to assist in performing the


> following:
>
> ----------------
>
> 2a) create two functions e "encode" and d "decode" each with three
> waveform parameters w1 "carrier", w2 "audio" and w3 "signal"; such

that:
>
> w3 = func e( w1, w2)
> w2 = func d( w3, w1)
> assuming also that w1 = func d( w3, w2)
>
> eg. if w1 = 100Khz sine and w2 = 10Khz sine then
>
> func e( 100000, 10000) would result in w3 = 110000 sine
>
> and
>
> func d( 110000, 100000) would result in w2 = 10000 sine.
>
> Note: for func e that w3 must equal w1 modulated by w2. Further that

for
> func d, w2 must equal w3 demodulated by w2.
>
> ----------------


Try using the formula for the sine of the difference of two angles.

Sin ( A - B ) = Sin ( A) Cos ( B ) - Cos ( A ) Sin ( B )

where Cos ( x ) = Sin ( x + pi/2 )

Herbert

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mixing analog and digital in SoC Andy Luotto Verilog 4 05-25-2007 07:37 AM
Mixing synchronous and asynchronous reset KCL FPGA 3 03-28-2005 08:01 AM
mixing sine waves Me DSP 9 05-16-2004 10:32 AM
mixing LVDS data Herwin FPGA 1 02-09-2004 11:10 AM


All times are GMT +1. The time now is 01:23 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved