Skip to content

Wrong dB normalization for TFR plots #11091

Closed

Description

@Martin2Constant

Bug description

When using the plot() method on an AverageTFR object with the dB argument set to True, the dB normalization applied is 20*log10(data) instead of 10*log10(data) (which is what is specified in the documentation).
If I'm not mistaken, 20*log10(data) dB normalization is for amplitude data, not power data. I spotted this problem with this function, but it probably applies to other functions where the dB argument can be specified.

I suppose the problem lies here:

if dB:
data = 20 * np.log10(data)
from the recent commit 4a1bf6b

Activity

  1. welcome commented on Aug 25, 2022

    @welcome

    Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

  2. drammock commented on Aug 25, 2022

    @drammock
    Member

    I took a quick look, it appears that we need to keep track of whether data was complex so we can conditionally change the coef from 10 to 20 only in that case. @Martin2Constant are you up for making a PR to fix this?

  3. added this to the 1.2 milestone on Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions