sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Using --combine multiply with a WAV and synth input
@ 2018-09-13  5:25 zoned out
  0 siblings, 0 replies; only message in thread
From: zoned out @ 2018-09-13  5:25 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 2005 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 3801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-13  5:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13  5:25 Using --combine multiply with a WAV and synth input zoned out

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).