Comments (5)
An update: I've implemented the Hann window and tested on retrained models on our internal ViSQOL. For speech, there were some improvements in MSE (.57 to .50 for exponential model, .15 to .15 (unchanged) for lattice models) . For audio SVR models, the metrics did not change significantly for most audio samples (e.g. typically less than .05 MOS), but there are a few samples such as low bitrate music where the subjective score is low that have a significant change in estimated MOS.
Since this requires retraining speech models, I'll be pushing this out with the new models and a new set of conformance scores as a new ViSQOL version.
from visqol.
Great question. This change was implemented before I was involved, so I may be missing some context. However, this is my understanding. The gamamtone filterbank is used directly on the time domain signal instead of FFT. The gammatone signal is inherently windowed due to the shape of the gamma distribution, so unlike a regular STFT, windowing is not necessary. It may be good to confirm this with the original authors. See the image here for more info on the gammatone filterbank.
https://en.wikipedia.org/wiki/Gammatone_filter
from visqol.
I did some investigation into the matter.
I found a Python implementation of the same gammatone filter-bank, over at gammatone/filters.py and used it to create a python mock of the implementation in visqol, as best I understand it (main logic in gammatone_spectrogram.c
). Results are worrying
import librosa
import librosa.display
import numpy as np
from gammatone.filters import centre_freqs, make_erb_filters
# from src/visqol_manager.cc
kNumBandsAudio = 32
kMinimumFreq = 50
kOverlap = 0.25
# from src/include/analysis_window.h
window_duration = 0.08
# compare src/equivalent_rectangular_bandwidth.cc to function make_erb_filters()
# they use the same constants and have similar logic, and seem based on
# code written by Malcolm Slaney on June 11, 1998, including dividing the order-8 filter into 4 order-2 sections
fs = 48000
window_duration_samples = int(fs * window_duration)
hop_length_samples = int(fs * window_duration*kOverlap)
# python logic uses max frequency of fs / 2, exactly like in src/gammatone_spectrogram_builder.cc line 41
erb_frequencies = centre_freqs(fs, kNumBandsAudio, kMinimumFreq)
gammatone_filters = make_erb_filters(fs, erb_frequencies)
audio, _ = librosa.load(librosa.example('trumpet', hq=True), sr=fs)
# let's look at only 1 second
audio = audio[:fs]
windowed_audio = librosa.util.frame(audio, window_duration_samples, hop_length_samples)
# shape of windowed_audio is now (3840, 47) - 47 windows of 80ms overlapping by 75%
# for comparison's sake - we'll also use a window function
window = np.hanning(window_duration_samples)
output = np.zeros((filters.shape[0], windowed_audio.shape[1]), dtype=np.float32)
output_windowed = np.zeros((filters.shape[0], windowed_audio.shape[1]), dtype=np.float32)
for i in tqdm(range(windowed_audio.shape[1])):
# calculate with no windowing
filtered = erb_filterbank(windowed_audio[:, i], filters)
output[:, i] = np.sum(filtered ** 2, axis=1)
# calculate with windowing
filtered = erb_filterbank(windowed_audio[:, i] * window, filters)
output_windowed[:, i] = np.sum(filtered ** 2, axis=1)
# display log-power spectrograms, flip rows of outputs so low frequencies are at the bottom
fig, axes = plt.subplots(2,1, figsize=(8,8))
axes[0].set_title('No Window Function')
librosa.display.specshow(
librosa.power_to_db(output[::-1], ref=np.max),
ax=axes[0]
)
axes[1].set_title('Hanning Window')
librosa.display.specshow(
librosa.power_to_db(output_windowed[::-1], ref=np.max),
ax=axes[1]
)
plt.show()
The output as I run it on my system looks like this:
As far as I can tell, there are severe windowing artifacts in the gammatone spectrogram. A next step would be to check if this happens with the actual C++ code in VISQOL, though I see no reason for the results to be different. I hope this helps some.
from visqol.
That is a very nice analysis, thank you for that. I agree that we should look into this further. looked in the trumpet file and a log-frequency STFT does not have the vertical banding artifacts. With this evidence I'm inclined to think that the artifacts are in ViSQOL as well.
from visqol.
A fix for this was merged in #66.
from visqol.
Related Issues (20)
- install python package failed HOT 3
- Segmentation fault (core dumped)
- What kind of question is that HOT 3
- Cannot be used for testing Opus encoded files? HOT 2
- Input sample rate 8kHz HOT 2
- M2 Mac issue
- Hello, everyone. When i build visqol, why the warning saying Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/4ce3e4da2e21ae4dfcee9366415e55f408c884ec.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found HOT 2
- Does anyone can share the VISQOL package on Linux or Windows HOT 1
- Reference File is shorter than degraded file -> MemoryError: std::bad_alloc HOT 2
- Please specify the supported Python versions. HOT 1
- Does visqol use gpu? Best settings for evaluating noise supression? HOT 2
- Building fails under Ubuntu 18.04 with GCC 7 HOT 3
- ImportError: initialization failed when trying to import in python HOT 2
- Do not get the maximum of MOS value using two same audio under speech mode HOT 2
- MOS-LQO results are low in speech mode
- Build did NOT complete successfully
- SegFault with Python bindings HOT 1
- Shows Build did NOT complete successfully when building visqol HOT 2
- Build the bazel failed
- build visqol with python
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visqol.