{
  "id": 499162,
  "title": "Question about Mel Spectrograms",
  "url": "/competitions/birdclef-2024/discussion/499162",
  "author_name": "",
  "post_date": "2024-04-30T22:28:12.217842700Z",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I'm currently doing something like this:<br>\n<code>mfccs = librosa.feature.mfcc(y=sound, sr=sample_rate, n_mfcc=samples_per_mfcc, n_fft=n_fft, hop_length=hop_length)</code><br>\nto get spectrograms for training. For the spectrograms that this outputs, are the units in decibels?? If that's the case, I looked at the maximum value of some of these outputs, and some of them are <strong>above 200 decibels</strong>, which can't be right.</p>\n<p>Trying to do some data augmentation.</p>",
  "messages": [
    {
      "id": "2785577",
      "postDate": "04/30/2024 22:28:12",
      "content": "<p>I'm currently doing something like this:<br>\n<code>mfccs = librosa.feature.mfcc(y=sound, sr=sample_rate, n_mfcc=samples_per_mfcc, n_fft=n_fft, hop_length=hop_length)</code><br>\nto get spectrograms for training. For the spectrograms that this outputs, are the units in decibels?? If that's the case, I looked at the maximum value of some of these outputs, and some of them are <strong>above 200 decibels</strong>, which can't be right.</p>\n<p>Trying to do some data augmentation.</p>",
      "rawMarkdown": "I'm currently doing something like this:\n` mfccs = librosa.feature.mfcc(y=sound, sr=sample_rate, n_mfcc=samples_per_mfcc, n_fft=n_fft, hop_length=hop_length)`\nto get spectrograms for training. For the spectrograms that this outputs, are the units in decibels?? If that's the case, I looked at the maximum value of some of these outputs, and some of them are **above 200 decibels**, which can't be right.\n\nTrying to do some data augmentation.",
      "votes": null
    },
    {
      "id": "2786629",
      "postDate": "05/01/2024 11:44:25",
      "content": "<p>You have to use a log transform to get decibels. For instance using this: <a href=\"https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html#librosa.amplitude_to_db\" target=\"_blank\">https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html#librosa.amplitude_to_db</a></p>",
      "rawMarkdown": "You have to use a log transform to get decibels. For instance using this: https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html#librosa.amplitude_to_db",
      "votes": null
    },
    {
      "id": "2787103",
      "postDate": "05/01/2024 15:32:01",
      "content": "<p>Ok, that makes sense. So before converting, I assume whatever metric that's being used scales linearly? For example, if I wanted double the loudness, I'd just multiply it by 2?</p>",
      "rawMarkdown": "Ok, that makes sense. So before converting, I assume whatever metric that's being used scales linearly? For example, if I wanted double the loudness, I'd just multiply it by 2?",
      "votes": null
    },
    {
      "id": "2787162",
      "postDate": "05/01/2024 16:00:06",
      "content": "<p>what do you mean by \"whatever metric that's being used \"?</p>\n<p>Note that loudness is not a linear function of sound intensity, see <a href=\"http://hyperphysics.phy-astr.gsu.edu/hbase/Sound/loud.html\" target=\"_blank\">http://hyperphysics.phy-astr.gsu.edu/hbase/Sound/loud.html</a> or <a href=\"https://en.wikipedia.org/wiki/Loudness\" target=\"_blank\">https://en.wikipedia.org/wiki/Loudness</a></p>",
      "rawMarkdown": "what do you mean by \"whatever metric that's being used \"?\n\nNote that loudness is not a linear function of sound intensity, see http://hyperphysics.phy-astr.gsu.edu/hbase/Sound/loud.html or https://en.wikipedia.org/wiki/Loudness",
      "votes": null
    },
    {
      "id": "2787253",
      "postDate": "05/01/2024 16:39:21",
      "content": "<p>That's interesting, thanks.</p>",
      "rawMarkdown": "That's interesting, thanks.",
      "votes": null
    },
    {
      "id": "2787505",
      "postDate": "05/01/2024 19:00:48",
      "content": "<p>It is precisely because of this that decibels were invented. When a sound intensity is multiplied by 10, you get 10 dB more, and a loudness multiplied by only 2.</p>",
      "rawMarkdown": "It is precisely because of this that decibels were invented. When a sound intensity is multiplied by 10, you get 10 dB more, and a loudness multiplied by only 2.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2786629,
      "author_name": "cpmpml",
      "author_url": "",
      "post_date": "05/01/2024 11:44:25",
      "content": "<p>You have to use a log transform to get decibels. For instance using this: <a href=\"https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html#librosa.amplitude_to_db\" target=\"_blank\">https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html#librosa.amplitude_to_db</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 2787103,
          "author_name": "rfeng12",
          "author_url": "",
          "post_date": "05/01/2024 15:32:01",
          "content": "<p>Ok, that makes sense. So before converting, I assume whatever metric that's being used scales linearly? For example, if I wanted double the loudness, I'd just multiply it by 2?</p>",
          "votes": null,
          "replies": [
            {
              "id": 2787162,
              "author_name": "cpmpml",
              "author_url": "",
              "post_date": "05/01/2024 16:00:06",
              "content": "<p>what do you mean by \"whatever metric that's being used \"?</p>\n<p>Note that loudness is not a linear function of sound intensity, see <a href=\"http://hyperphysics.phy-astr.gsu.edu/hbase/Sound/loud.html\" target=\"_blank\">http://hyperphysics.phy-astr.gsu.edu/hbase/Sound/loud.html</a> or <a href=\"https://en.wikipedia.org/wiki/Loudness\" target=\"_blank\">https://en.wikipedia.org/wiki/Loudness</a></p>",
              "votes": null,
              "replies": [
                {
                  "id": 2787253,
                  "author_name": "rfeng12",
                  "author_url": "",
                  "post_date": "05/01/2024 16:39:21",
                  "content": "<p>That's interesting, thanks.</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2787505,
                      "author_name": "cpmpml",
                      "author_url": "",
                      "post_date": "05/01/2024 19:00:48",
                      "content": "<p>It is precisely because of this that decibels were invented. When a sound intensity is multiplied by 10, you get 10 dB more, and a loudness multiplied by only 2.</p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2785577": "I'm currently doing something like this:\n` mfccs = librosa.feature.mfcc(y=sound, sr=sample_rate, n_mfcc=samples_per_mfcc, n_fft=n_fft, hop_length=hop_length)`\nto get spectrograms for training. For the spectrograms that this outputs, are the units in decibels?? If that's the case, I looked at the maximum value of some of these outputs, and some of them are **above 200 decibels**, which can't be right.\n\nTrying to do some data augmentation.",
    "2786629": "You have to use a log transform to get decibels. For instance using this: https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html#librosa.amplitude_to_db",
    "2787103": "Ok, that makes sense. So before converting, I assume whatever metric that's being used scales linearly? For example, if I wanted double the loudness, I'd just multiply it by 2?",
    "2787162": "what do you mean by \"whatever metric that's being used \"?\n\nNote that loudness is not a linear function of sound intensity, see http://hyperphysics.phy-astr.gsu.edu/hbase/Sound/loud.html or https://en.wikipedia.org/wiki/Loudness",
    "2787253": "That's interesting, thanks.",
    "2787505": "It is precisely because of this that decibels were invented. When a sound intensity is multiplied by 10, you get 10 dB more, and a loudness multiplied by only 2."
  },
  "source": "meta"
}