{
  "id": 217538,
  "title": "Number of mel filterbanks",
  "url": "/competitions/rfcx-species-audio-detection/discussion/217538",
  "author_name": "",
  "post_date": "2021-02-07T07:53:47.950649200Z",
  "votes": 3,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Is it related to the number of Mel-filterbanks to extract features?</p>\n<p>I have used the value: 128</p>\n<p>I wonder if the value improves the model's accuracy.</p>",
  "messages": [
    {
      "id": "1189722",
      "postDate": "02/07/2021 07:53:47",
      "content": "<p>Is it related to the number of Mel-filterbanks to extract features?</p>\n<p>I have used the value: 128</p>\n<p>I wonder if the value improves the model's accuracy.</p>",
      "rawMarkdown": "Is it related to the number of Mel-filterbanks to extract features?\n\nI have used the value: 128\n\nI wonder if the value improves the model's accuracy.",
      "votes": null
    },
    {
      "id": "1189817",
      "postDate": "02/07/2021 08:55:35",
      "content": "<p>I'm using 64, because 128 gives me \"empty channels\" warning.</p>",
      "rawMarkdown": "I'm using 64, because 128 gives me \"empty channels\" warning.",
      "votes": null
    },
    {
      "id": "1190156",
      "postDate": "02/07/2021 14:17:46",
      "content": "<p>Increasing the number of mel filterbanks helps, but your training time will also increase.</p>",
      "rawMarkdown": "Increasing the number of mel filterbanks helps, but your training time will also increase.",
      "votes": null
    },
    {
      "id": "1190158",
      "postDate": "02/07/2021 14:21:29",
      "content": "<p>In this case, you have to increase n_fft.</p>",
      "rawMarkdown": "In this case, you have to increase n_fft.",
      "votes": null
    },
    {
      "id": "1190786",
      "postDate": "02/08/2021 02:16:55",
      "content": "<p>Thank you for your reply. </p>\n<p>Looking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.</p>",
      "rawMarkdown": "Thank you for your reply. \n\nLooking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.",
      "votes": null
    },
    {
      "id": "1190903",
      "postDate": "02/08/2021 05:17:48",
      "content": "<p>My understanding (and I'm not an expert on spectrograms), is that making a mel spectrogram on a 60 second sound file creates a 2D array of height <code>H</code> and width <code>W</code>.</p>\n<p>Increasing <code>mel filters</code> increases the height <code>H</code> (the frequency dimension), and you should set <code>n_fft</code> large enough so that you don't get \"empty channels\". (Basically <code>n_fft</code> and <code>mel filters</code> are the same thing. If you do a basic spectrogram then <code>n_fft</code> is  your height. Next choosing <code>mel filters</code> picks a new height and just rescales the y axis when converting a spectrogram into a mel spectrogram) </p>\n<p>Next you can consider adjusting the width <code>W</code> (the time dimension) by adjusting <code>hop_length</code> and <code>win_length</code>. Note that there is a tradeoff. You can accomplish any combination of <code>H</code> and <code>W</code> you desire. But your selection of <code>hop_length</code> and <code>win_length</code> decides whether there is more information in frequency <code>H</code> or time <code>W</code>.</p>\n<p>For example, just because you have a large <code>H</code> or <code>W</code> doesn't mean you have good resolution (i.e. lots of information in that dimension). Depending on <code>hop_length</code> and <code>win_length</code>, either the frequency or time is \"blurred\" and doesn't contain full information in that dimension.</p>",
      "rawMarkdown": "My understanding (and I'm not an expert on spectrograms), is that making a mel spectrogram on a 60 second sound file creates a 2D array of height `H` and width `W`.\n\nIncreasing `mel filters` increases the height `H` (the frequency dimension), and you should set `n_fft` large enough so that you don't get \"empty channels\". (Basically `n_fft` and `mel filters` are the same thing. If you do a basic spectrogram then `n_fft` is  your height. Next choosing `mel filters` picks a new height and just rescales the y axis when converting a spectrogram into a mel spectrogram) \n\nNext you can consider adjusting the width `W` (the time dimension) by adjusting `hop_length` and `win_length`. Note that there is a tradeoff. You can accomplish any combination of `H` and `W` you desire. But your selection of `hop_length` and `win_length` decides whether there is more information in frequency `H` or time `W`.\n\nFor example, just because you have a large `H` or `W` doesn't mean you have good resolution (i.e. lots of information in that dimension). Depending on `hop_length` and `win_length`, either the frequency or time is \"blurred\" and doesn't contain full information in that dimension.",
      "votes": null
    },
    {
      "id": "1191063",
      "postDate": "02/08/2021 08:09:59",
      "content": "<p><em>\"Looking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.\"</em></p>\n<p>Like Chris has said, they have a direct relationship, not an inverse relation. Please don't lower n_fft if you increase mel filter. I believe with default n_fft of 2048, you should be able to increase the mels from 128 to 256 without any issue and see a slight improvement in score. You can refer to : <a href=\"https://www.kaggle.com/allohvk/the-nuts-and-bolts-of-sound-feature-engineering\" target=\"_blank\">https://www.kaggle.com/allohvk/the-nuts-and-bolts-of-sound-feature-engineering</a> for a theoretical explanation of these params and a peek into what they actually signify</p>",
      "rawMarkdown": "*\"Looking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.\"*\n\nLike Chris has said, they have a direct relationship, not an inverse relation. Please don't lower n_fft if you increase mel filter. I believe with default n_fft of 2048, you should be able to increase the mels from 128 to 256 without any issue and see a slight improvement in score. You can refer to : https://www.kaggle.com/allohvk/the-nuts-and-bolts-of-sound-feature-engineering for a theoretical explanation of these params and a peek into what they actually signify",
      "votes": null
    },
    {
      "id": "1191199",
      "postDate": "02/08/2021 10:14:40",
      "content": "<p><a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> <a href=\"https://www.kaggle.com/allohvk\" target=\"_blank\">@allohvk</a> Thanks for the detailed explanations. <br>\nThen I will try to the values and consider another model to improve the score.</p>",
      "rawMarkdown": "cdeotte @allohvk Thanks for the detailed explanations. \nThen I will try to the values and consider another model to improve the score.",
      "votes": null
    },
    {
      "id": "1191200",
      "postDate": "02/08/2021 10:16:42",
      "content": "<p>Thank you for your reply. </p>",
      "rawMarkdown": "Thank you for your reply.",
      "votes": null
    },
    {
      "id": "2945678",
      "postDate": "08/03/2024 16:31:36",
      "content": "<p>Very interesting</p>",
      "rawMarkdown": "Very interesting",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1189817,
      "author_name": "atamazian",
      "author_url": "",
      "post_date": "02/07/2021 08:55:35",
      "content": "<p>I'm using 64, because 128 gives me \"empty channels\" warning.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1190158,
          "author_name": "tugstugi",
          "author_url": "",
          "post_date": "02/07/2021 14:21:29",
          "content": "<p>In this case, you have to increase n_fft.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1191200,
          "author_name": "kbh0287",
          "author_url": "",
          "post_date": "02/08/2021 10:16:42",
          "content": "<p>Thank you for your reply. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1190156,
      "author_name": "tugstugi",
      "author_url": "",
      "post_date": "02/07/2021 14:17:46",
      "content": "<p>Increasing the number of mel filterbanks helps, but your training time will also increase.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1190786,
          "author_name": "kbh0287",
          "author_url": "",
          "post_date": "02/08/2021 02:16:55",
          "content": "<p>Thank you for your reply. </p>\n<p>Looking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1190903,
          "author_name": "cdeotte",
          "author_url": "",
          "post_date": "02/08/2021 05:17:48",
          "content": "<p>My understanding (and I'm not an expert on spectrograms), is that making a mel spectrogram on a 60 second sound file creates a 2D array of height <code>H</code> and width <code>W</code>.</p>\n<p>Increasing <code>mel filters</code> increases the height <code>H</code> (the frequency dimension), and you should set <code>n_fft</code> large enough so that you don't get \"empty channels\". (Basically <code>n_fft</code> and <code>mel filters</code> are the same thing. If you do a basic spectrogram then <code>n_fft</code> is  your height. Next choosing <code>mel filters</code> picks a new height and just rescales the y axis when converting a spectrogram into a mel spectrogram) </p>\n<p>Next you can consider adjusting the width <code>W</code> (the time dimension) by adjusting <code>hop_length</code> and <code>win_length</code>. Note that there is a tradeoff. You can accomplish any combination of <code>H</code> and <code>W</code> you desire. But your selection of <code>hop_length</code> and <code>win_length</code> decides whether there is more information in frequency <code>H</code> or time <code>W</code>.</p>\n<p>For example, just because you have a large <code>H</code> or <code>W</code> doesn't mean you have good resolution (i.e. lots of information in that dimension). Depending on <code>hop_length</code> and <code>win_length</code>, either the frequency or time is \"blurred\" and doesn't contain full information in that dimension.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1191063,
          "author_name": "allohvk",
          "author_url": "",
          "post_date": "02/08/2021 08:09:59",
          "content": "<p><em>\"Looking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.\"</em></p>\n<p>Like Chris has said, they have a direct relationship, not an inverse relation. Please don't lower n_fft if you increase mel filter. I believe with default n_fft of 2048, you should be able to increase the mels from 128 to 256 without any issue and see a slight improvement in score. You can refer to : <a href=\"https://www.kaggle.com/allohvk/the-nuts-and-bolts-of-sound-feature-engineering\" target=\"_blank\">https://www.kaggle.com/allohvk/the-nuts-and-bolts-of-sound-feature-engineering</a> for a theoretical explanation of these params and a peek into what they actually signify</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1191199,
          "author_name": "kbh0287",
          "author_url": "",
          "post_date": "02/08/2021 10:14:40",
          "content": "<p><a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> <a href=\"https://www.kaggle.com/allohvk\" target=\"_blank\">@allohvk</a> Thanks for the detailed explanations. <br>\nThen I will try to the values and consider another model to improve the score.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2945678,
      "author_name": "anthoniestar98",
      "author_url": "",
      "post_date": "08/03/2024 16:31:36",
      "content": "<p>Very interesting</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1189722": "Is it related to the number of Mel-filterbanks to extract features?\n\nI have used the value: 128\n\nI wonder if the value improves the model's accuracy.",
    "1189817": "I'm using 64, because 128 gives me \"empty channels\" warning.",
    "1190156": "Increasing the number of mel filterbanks helps, but your training time will also increase.",
    "1190158": "In this case, you have to increase n_fft.",
    "1190786": "Thank you for your reply. \n\nLooking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.",
    "1190903": "My understanding (and I'm not an expert on spectrograms), is that making a mel spectrogram on a 60 second sound file creates a 2D array of height `H` and width `W`.\n\nIncreasing `mel filters` increases the height `H` (the frequency dimension), and you should set `n_fft` large enough so that you don't get \"empty channels\". (Basically `n_fft` and `mel filters` are the same thing. If you do a basic spectrogram then `n_fft` is  your height. Next choosing `mel filters` picks a new height and just rescales the y axis when converting a spectrogram into a mel spectrogram) \n\nNext you can consider adjusting the width `W` (the time dimension) by adjusting `hop_length` and `win_length`. Note that there is a tradeoff. You can accomplish any combination of `H` and `W` you desire. But your selection of `hop_length` and `win_length` decides whether there is more information in frequency `H` or time `W`.\n\nFor example, just because you have a large `H` or `W` doesn't mean you have good resolution (i.e. lots of information in that dimension). Depending on `hop_length` and `win_length`, either the frequency or time is \"blurred\" and doesn't contain full information in that dimension.",
    "1191063": "*\"Looking at your answer to the question below, I would like to ask if I should lower the n_fft if I raise the value of the number of Mel filterbanks.\"*\n\nLike Chris has said, they have a direct relationship, not an inverse relation. Please don't lower n_fft if you increase mel filter. I believe with default n_fft of 2048, you should be able to increase the mels from 128 to 256 without any issue and see a slight improvement in score. You can refer to : https://www.kaggle.com/allohvk/the-nuts-and-bolts-of-sound-feature-engineering for a theoretical explanation of these params and a peek into what they actually signify",
    "1191199": "cdeotte @allohvk Thanks for the detailed explanations. \nThen I will try to the values and consider another model to improve the score.",
    "1191200": "Thank you for your reply.",
    "2945678": "Very interesting"
  },
  "source": "meta"
}