Skip to main content
added bug tag and header
Source Link
Daniel W
  • 3.4k
  • 18
  • 32

Bug introduced in 11.3 or earlier

CASE:4075745


I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

ListLinePlot[
  AudioData[
    AudioGenerator[{"Sin", 1000}, 0.1, SampleRate -> 48000]
  ][[1, ;; 100]]
]

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

ListLinePlot[
  AudioData[
    AudioGenerator[{"Sin", 1000}, 0.1, SampleRate -> 48000]
  ][[1, ;; 100]]
]

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

Bug introduced in 11.3 or earlier

CASE:4075745


I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

ListLinePlot[
  AudioData[
    AudioGenerator[{"Sin", 1000}, 0.1, SampleRate -> 48000]
  ][[1, ;; 100]]
]

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

Tweeted twitter.com/StackMma/status/1004865677340106752
Added code to generate jagged sine wave
Source Link
Daniel W
  • 3.4k
  • 18
  • 32

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

ListLinePlot[
  AudioData[
    AudioGenerator[{"Sin", 1000}, 0.1, SampleRate -> 48000]
  ][[1, ;; 100]]
]

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

ListLinePlot[
  AudioData[
    AudioGenerator[{"Sin", 1000}, 0.1, SampleRate -> 48000]
  ][[1, ;; 100]]
]

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

Formatted code so it is easier to copy
Source Link
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

In[1]:= a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
 
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

In[2]:= First[AudioData[Audio[a]]]
 
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

In[1]:= a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
 
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

In[2]:= First[AudioData[Audio[a]]]
 
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

I have been experimenting with using Audio and associated functions for data acquisition using an external sound card. I came across a bizarre problem with generated sine waves, where jagged teeth would appear in the waveform.

Mathematica graphics

This is a problem in the audio itself and not a display or data extraction error, as verified by looking at the output of the sound card on an oscilloscope. This originally occurred when using AudioGenerator, but the error persisted when passing an array of Sin values to Audio.

The problem appears to be caused by Audio interpreting high-precision (but not exact) values of 1/2 as 0.25.

a = N[{Sin[(25*Pi)/6], 1/2, 0.5, 0.4999999, 0.49999999, Sin[(25.*Pi)/6]}]
(* {0.5, 0.5, 0.5, 0.5, 0.5, 0.5} *)

First[AudioData[Audio[a]]]
(* {0.5, 0.5, 0.5, 0.5, 0.25, 0.25} *)

This error was observed on 11.3 on macOS, but also occurs on Mathematica Online. The issue has been reported to Wolfram support [CASE:4075745].

Source Link
Daniel W
  • 3.4k
  • 18
  • 32
Loading