Using --combine multiply with a WAV and synth input

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,


I'm trying to use "--combine multiply" with two inputs, one a WAV and the other a sinewave at X(offset) frequency.


The WAV is IQ data from SDR (Software Defined Radio) with a samplerate of 1125000, 2 channels, 16 bit.

Here Samplerate=Bandwidth. So 0Hz to 1125000Hz with center frequency at 562500Hz.


The result I'm trying to achieve is frequency translation. That is, move one frequency that is offset from the center frequency to the center frequency.


Currently I can achieve this with the following command lines: (other effects removed for clarity)


Generate sine WAV file with: (Sine @ 392KHz - 2 channel for 10.7 seconds with 1125000 samplerate)

 sox -c 2 -r 1125000 -n offsetsine.wav synth 10.7 sine 392000.0


Combine multiply the sinewave  with WAV with:
 sox --combine multiply sdr_input.wav offsetsine.wav sdr_output

In this example the frequency of interest is at 392000Hz, we multipy it with the sinewave at 392000Hz which shifts it to center or 562500Hz.

This works fine and the result is as expected. With the exception that the generated sinewave file is not 100% with duration.

Now the problem I'm having, these SDR IQ files can be very large (Mb to Gb) and creating a sine file of equal duration (which also is a problem) seems unnecessary if SoX can just generate the sinewave on the fly and multiply it.

Creating this command line is proving troublesome for me.

When I try substituting the 2nd input file for synth and setting length to "0" = "use the input length", all I get is SoX filling HDD and not stopping. The test file I'm using is only 48mb (approx. 10.7 seconds).

This command line does not work: 
sox --combine multiply sdr_input.wav -c 2 -r 1125000 -n sdr_output.wav synth 0 sine 392000.0

If I set synth length to 10.7 it does stop but the output is not right at all.


Is what I'm trying to do here achievable with SoX?


Any help with constructing this command line would be appreciated. Thanks in advance.

_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux