From: Robin Gareus Date: Mon, 25 Jul 2016 15:45:14 +0000 (+0200) Subject: plugin spectrum analysis: plot A/B X-Git-Tag: 5.0-rc1~15 X-Git-Url: https://main.carlh.net/gitweb/?p=ardour.git;a=commitdiff_plain;h=793ff25e081cb9a7b3c26dbe627e0c4766e3a800;hp=822810b88fd13d1764b5f686baa8edb3e27e95fc plugin spectrum analysis: plot A/B --- diff --git a/gtk2_ardour/plugin_eq_gui.cc b/gtk2_ardour/plugin_eq_gui.cc index 2ac9936d35..069f3733e1 100644 --- a/gtk2_ardour/plugin_eq_gui.cc +++ b/gtk2_ardour/plugin_eq_gui.cc @@ -808,26 +808,19 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr) float height = w->get_height(); cairo_set_source_rgb(cr, 0.0, 1.0, 0.0); - cairo_set_line_width (cr, 2.5); + cairo_set_line_width (cr, 1.5); for (uint32_t i = 0; i < _signal_input_fft->bins()-1; i++) { // x coordinate of bin i x = log10f(1.0 + (float)i / (float)_signal_input_fft->bins() * _log_coeff) / _log_max; x *= _analysis_width; - float power_out = power_to_dB(_signal_output_fft->power_at_bin(i)); - float power_in = power_to_dB(_signal_input_fft ->power_at_bin(i)); - float power = power_out - power_in; + float power_out = _signal_output_fft->power_at_bin (i) + 1e-30; + float power_in = _signal_input_fft ->power_at_bin (i) + 1e-30; + float power = power_to_dB (power_out / power_in); - if (ISINF(power)) { - if (power < 0) { - power = _min_dB - 1.0; - } else { - power = _max_dB - 1.0; - } - } else if (ISNAN(power)) { - power = _min_dB - 1.0; - } + assert (!ISINF(power)); + assert (!ISNAN(power)); float yCoeff = ( power - _min_dB) / (_max_dB - _min_dB);