High pitch sound artifact on import of 48k audio #46683

Closed
opened 2015-11-03 18:12:18 +01:00 by Jon · 22 comments

System Information
Linux Fedora 22 (kernel 4.2.3) with NVIDIA Corporation GK107 HDMI Audio Controller, GeForce GTX 650 video card.

Blender Version
Broken: 2.76
Worked: ??

Short description of error
The default settings for Blender are to work with 44.1k sample rate audio. When importing video or audio files with 48k sample rate audio, a high pitch "whine" artifact is introduced. This artifact is subtle, but quite noticeable in quiet sections of the audio.

Exact steps for others to reproduce the error
Import the attached WAV file (or load the "48k_audio_artifact.blend" file). You must then confirm that User Preferences -> System -> Sample Rate is set to the default "44.1k". Now just play the audio.

To "fix" the problem, go to User Preferences -> System -> Sample Rate and set to "48k"

Notes:
The mvi_6317.wav file was created from a video file recorded using a Canon 650d dSLR which records audio at 48k, I separated the audio to make a simpler test case for you developers, and to make the file sizes smaller. But, the problem exists identically in the original video file, which I can attach if anyone is interested, but it is 285MB.

[lapham@bilbo BlenderBug]$ ffmpeg -i mvi_6317.mov mvi_6317.wav
[lapham@bilbo BlenderBug]$ ffmpeg -i mvi_6317.wav
Input #0, wav, from 'mvi_6317.wav':

Metadata:
  encoder         : Lavf56.25.101
Duration: 00:00:47.18, bitrate: 1536 kb/s
  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s

Both the original video and audio play on all the normal video/audio apps without this high pitch sound.

I believe that the solution to this bug could be:

  1. when importing audio at a different sample rate, the user should be warned if the User Preferences -> System -> Sample Rate doesn't match.
  2. fix the conversion from 48k -> 44.1k to not have this artifact.

Thank you for your time

**System Information** Linux Fedora 22 (kernel 4.2.3) with NVIDIA Corporation GK107 HDMI Audio Controller, GeForce GTX 650 video card. **Blender Version** Broken: 2.76 Worked: ?? **Short description of error** The default settings for Blender are to work with 44.1k sample rate audio. When importing video or audio files with 48k sample rate audio, a high pitch "whine" artifact is introduced. This artifact is subtle, but quite noticeable in quiet sections of the audio. **Exact steps for others to reproduce the error** Import the attached WAV file (or load the "48k_audio_artifact.blend" file). You must then confirm that User Preferences -> System -> Sample Rate is set to the default "44.1k". Now just play the audio. To "fix" the problem, go to User Preferences -> System -> Sample Rate and set to "48k" Notes: The mvi_6317.wav file was created from a video file recorded using a Canon 650d dSLR which records audio at 48k, I separated the audio to make a simpler test case for you developers, and to make the file sizes smaller. But, the problem exists identically in the original video file, which I can attach if anyone is interested, but it is 285MB. [lapham@bilbo BlenderBug]$ ffmpeg -i mvi_6317.mov mvi_6317.wav [lapham@bilbo BlenderBug]$ ffmpeg -i mvi_6317.wav Input #0, wav, from 'mvi_6317.wav': ``` Metadata: encoder : Lavf56.25.101 Duration: 00:00:47.18, bitrate: 1536 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s ``` Both the original video and audio play on all the normal video/audio apps without this high pitch sound. I believe that the solution to this bug could be: 1) when importing audio at a different sample rate, the user should be warned if the User Preferences -> System -> Sample Rate doesn't match. 2) fix the conversion from 48k -> 44.1k to not have this artifact. Thank you for your time
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @jplap

Added subscriber: @jplap
Author

On rendering a video, the audio artifact is baked into the resultant video/audio file. Now any video playing app (not just Blender) will produce the high pitch sound. See the file "mvi_6317_ARTIFACT_BAKED_IN.wav" to hear it.

On rendering a video, the audio artifact is baked into the resultant video/audio file. Now any video playing app (not just Blender) will produce the high pitch sound. See the file "mvi_6317_ARTIFACT_BAKED_IN.wav" to hear it.
Member

Added subscribers: @neXyon, @Blendify

Added subscribers: @neXyon, @Blendify
Member

I do not see any files? please upload the files

@neXyon mind testing this with new audio?

I do not see any files? please upload the files @neXyon mind testing this with new audio?
Author

I would like to add a further note to this bug. One might be tempted to say that this is not a bug, because there is a solution to the problem, simple set User Preferences -> System -> Sample Rate appropriately.

However, from my experience, I noticed this bug only after producing something like 15 videos over the course of a few weeks. Because it is somewhat subtle, it really is not very apparent in videos with lots of noise (but you can hear it even then if you pay attention). I have since had to go back and redo all my previous videos. Frustrating!

I am a relatively well versed computer user and video editor (using other programs, I'm new to Blender). This is the sort of subtle bug that will drive people away from Blender. It took me 2 days of experimentation to discover what caused the bug, and find a solution.

Incidentally, I realize that I never mentioned that in addition to User Preferences -> System -> Sample Rate, one must also make sure that Properties -> Scene -> Audio -> Rate is set appropriately. Ugh.

Thanks again for your time.

I would like to add a further note to this bug. One might be tempted to say that this is not a bug, because there is a solution to the problem, simple set User Preferences -> System -> Sample Rate appropriately. However, from my experience, I noticed this bug only after producing something like 15 videos over the course of a few weeks. Because it is somewhat subtle, it really is not very apparent in videos with lots of noise (but you can hear it even then if you pay attention). I have since had to go back and redo all my previous videos. Frustrating! I am a relatively well versed computer user and video editor (using other programs, I'm new to Blender). This is the sort of subtle bug that will drive people away from Blender. It took me 2 days of experimentation to discover what caused the bug, and find a solution. Incidentally, I realize that I never mentioned that in addition to User Preferences -> System -> Sample Rate, one must also make sure that Properties -> Scene -> Audio -> Rate is set appropriately. Ugh. Thanks again for your time.
Author

In #46683#345012, @Blendify wrote:
I do not see any files? please upload the files

@neXyon mind testing this with new audio?

How do I attach files? I thought I did attach them when I created the bug report....

> In #46683#345012, @Blendify wrote: > I do not see any files? please upload the files > > @neXyon mind testing this with new audio? How do I attach files? I thought I did attach them when I created the bug report....
Member

Drag an drop them into the comment area

Drag an drop them into the comment area
Author
[48k_audio_artifact.blend](https://archive.blender.org/developer/F250530/48k_audio_artifact.blend) [mvi_6317.wav](https://archive.blender.org/developer/F250534/mvi_6317.wav)
Author
[mvi_6317_ARTIFACT_BAKED_IN.wav](https://archive.blender.org/developer/F250538/mvi_6317_ARTIFACT_BAKED_IN.wav)
Author

The last upload seems to have become embedded in an audio player... maybe that is just Chrome's doing. Anyway, the last upload (the 3rd upload) is the high pitch noise baked into an audio file so people can hear what it sounds like playing the original audio file (mvi_6317.wav) in Blender, with Blender configured to 44.1k instead of 48k sample rate.

The last upload seems to have become embedded in an audio player... maybe that is just Chrome's doing. Anyway, the last upload (the 3rd upload) is the high pitch noise baked into an audio file so people can hear what it sounds like playing the original audio file (mvi_6317.wav) in Blender, with Blender configured to 44.1k instead of 48k sample rate.
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Joerg Mueller self-assigned this 2015-11-03 19:12:31 +01:00
Member

Hi,

I know you don't want to hear it, but this is not a bug of Blender. xD

This high pitched frequency is present in every player I tried it with, it's a sound at about 17555 Hz, which you might or might not hear depending on your age (the older you get, the lower the frequencies you can hear).

Furtunately there is a way to find out, you can just open the file with audacity and plot the spectrum and you will get this:

spectrum.png

So when you actually remove this frequency with a notch filter, you won't have that problem anymore:

mvi_6317_notch_filtered.wav

To understand why you can "better" hear this high pitched sound in Blender is easy: Blender by default uses a very low quality resampling for playback, just simple linear interpolation. This causes an effect called aliasing: https://en.wikipedia.org/wiki/Aliasing. Now when you export the sound with Blender it should not have this problem as a very high quality resampler is used for the export. I tried this and when I render the audio, the file sounds the same as the original, which in my case means I can hear the high pitch in both of them equaly.

Unfortunately Blender does not support editing of audio (yet), so you will have to remove these high frequencies with another audio application.

Hi, I know you don't want to hear it, but this is not a bug of Blender. xD This high pitched frequency is present in every player I tried it with, it's a sound at about 17555 Hz, which you might or might not hear depending on your age (the older you get, the lower the frequencies you can hear). Furtunately there is a way to find out, you can just open the file with audacity and plot the spectrum and you will get this: ![spectrum.png](https://archive.blender.org/developer/F250547/spectrum.png) So when you actually remove this frequency with a notch filter, you won't have that problem anymore: [mvi_6317_notch_filtered.wav](https://archive.blender.org/developer/F250549/mvi_6317_notch_filtered.wav) To understand why you can "better" hear this high pitched sound in Blender is easy: Blender by default uses a very low quality resampling for playback, just simple linear interpolation. This causes an effect called aliasing: https://en.wikipedia.org/wiki/Aliasing. Now when you export the sound with Blender it should not have this problem as a very high quality resampler is used for the export. I tried this and when I render the audio, the file sounds the same as the original, which in my case means I can hear the high pitch in both of them equaly. Unfortunately Blender does not support editing of audio (yet), so you will have to remove these high frequencies with another audio application.
Member

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
Member

Btw: Audio mixdown does high quality, but normal animation rendering does not, that's indeed a bug, will fix in a second!

Btw: Audio mixdown does high quality, but normal animation rendering does not, that's indeed a bug, will fix in a second!

This issue was referenced by 8c25c1c484

This issue was referenced by 8c25c1c484aef9cde709143085a8e5b9a003b866
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

Joerg-

Thanks for the response!

That peak in the original sound file (the one you showed) is just normal microphone hiss. I have seen that peak for years in recordings. If you compare the spectrum of the original sound file to the "mvi_6317ARTIFACT_BAKED_IN.avi" (the third I uploaded) you get this:

compare_audio.jpg

All I did to create "mvi_6317ARTIFACT_BAKED_IN.avi" was import the original sound file into Blender, set the audio (in both locations) to 44.1k, then I rendered a new video. Then I used ffmpeg to separate the audio.

See those extra peaks? That is the problem.

Joerg- Thanks for the response! That peak in the original sound file (the one you showed) is just normal microphone hiss. I have seen that peak for years in recordings. If you compare the spectrum of the original sound file to the "mvi_6317ARTIFACT_BAKED_IN.avi" (the third I uploaded) you get this: ![compare_audio.jpg](https://archive.blender.org/developer/F250563/compare_audio.jpg) All I did to create "mvi_6317ARTIFACT_BAKED_IN.avi" was import the original sound file into Blender, set the audio (in both locations) to 44.1k, then I rendered a new video. Then I used ffmpeg to separate the audio. See those extra peaks? That is the problem.
Author

Wow, awesome Joerg! A bug fix so fast!

Wow, awesome Joerg! A bug fix so fast!
Member

Yep, those additional peaks are the antialiasing I talked about. With the current Blender version you will have to downmix the audio and multiplex that to your video by hand.

But I still think it would be better you get rid of this microphone hiss. I don't know how old you are, but I can still hear this and I'm sure any young audience of your videos will too.

Yep, those additional peaks are the antialiasing I talked about. With the current Blender version you will have to downmix the audio and multiplex that to your video by hand. But I still think it would be better you get rid of this microphone hiss. I don't know how old you are, but I can still hear this and I'm sure any young audience of your videos will too.
Author

Joerg-

I agree, removing the hiss would make the sound even nicer. :)

Thanks a lot for fixing this.

If I understand your bug fix correctly, we will still hear the antialiasing when playing back in the sequencer, but it will be removed when rendering an output video? If my understanding is correct, then why not make the sequencer use high quality audio too?

PS: for the current Blender there is an easier fix than downmixing and multiplexing... simply change the sample rate from 44.1k to 48k in Blender (in the 2 locations I mentioned earlier) and the problem disappears!

Joerg- I agree, removing the hiss would make the sound even nicer. :) Thanks a lot for fixing this. If I understand your bug fix correctly, we will still hear the antialiasing when playing back in the sequencer, but it will be removed when rendering an output video? If my understanding is correct, then why not make the sequencer use high quality audio too? PS: for the current Blender there is an easier fix than downmixing and multiplexing... simply change the sample rate from 44.1k to 48k in Blender (in the 2 locations I mentioned earlier) and the problem disappears!
Member

Yes, during playback the aliasing (not antialiasing...) will be there. It will be removed when rendering output video, yes. And as I wrote in the commit log, playback uses low quality resampling because of performance.

Yes, during playback the aliasing (not antialiasing...) will be there. It will be removed when rendering output video, yes. And as I wrote in the commit log, playback uses low quality resampling because of performance.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#46683
No description provided.