{
  "id": 268027,
  "title": "Q-Transform comparison: nnAudio vs GWPy",
  "url": "/competitions/g2net-gravitational-wave-detection/discussion/268027",
  "author_name": "",
  "post_date": "2021-08-25T16:49:47.293226200Z",
  "votes": 4,
  "comment_count": 12,
  "views": 0,
  "content": "<p>I was going through some of the discussions and fantastic notebooks here, like: <br>\n<a href=\"https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta\" target=\"_blank\">https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta</a><br>\nand <a href=\"https://www.kaggle.com/mistag/data-preprocessing-with-gwpy\" target=\"_blank\">https://www.kaggle.com/mistag/data-preprocessing-with-gwpy</a></p>\n<p>From these, I understand that nnAudio's <strong>\"cqt1992v2\"</strong> method is much faster by comparison. However, I find the CQT image from GWPy's <strong>\"q_transform\"</strong> method to be more interpretable to visualize a potential event. Is the y-axis of nnAudio's <strong>\"cqt1992v2\"</strong> returning frequency bin numbers?</p>\n<p>My question is, are these two methods returning similar things? If yes, then is there a way to transform nnAudio's <strong>\"cqt1992v2\"</strong> output to look something similar to that of GWPy's <strong>\"q_transform\"</strong> (log scale on frequency maybe)? <br>\nThanks!</p>",
  "messages": [
    {
      "id": "1490497",
      "postDate": "08/25/2021 16:49:47",
      "content": "<p>I was going through some of the discussions and fantastic notebooks here, like: <br>\n<a href=\"https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta\" target=\"_blank\">https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta</a><br>\nand <a href=\"https://www.kaggle.com/mistag/data-preprocessing-with-gwpy\" target=\"_blank\">https://www.kaggle.com/mistag/data-preprocessing-with-gwpy</a></p>\n<p>From these, I understand that nnAudio's <strong>\"cqt1992v2\"</strong> method is much faster by comparison. However, I find the CQT image from GWPy's <strong>\"q_transform\"</strong> method to be more interpretable to visualize a potential event. Is the y-axis of nnAudio's <strong>\"cqt1992v2\"</strong> returning frequency bin numbers?</p>\n<p>My question is, are these two methods returning similar things? If yes, then is there a way to transform nnAudio's <strong>\"cqt1992v2\"</strong> output to look something similar to that of GWPy's <strong>\"q_transform\"</strong> (log scale on frequency maybe)? <br>\nThanks!</p>",
      "rawMarkdown": "I was going through some of the discussions and fantastic notebooks here, like: \n[https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta](https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta)\nand [https://www.kaggle.com/mistag/data-preprocessing-with-gwpy](https://www.kaggle.com/mistag/data-preprocessing-with-gwpy)\n\nFrom these, I understand that nnAudio's **\"cqt1992v2\"** method is much faster by comparison. However, I find the CQT image from GWPy's **\"q_transform\"** method to be more interpretable to visualize a potential event. Is the y-axis of nnAudio's **\"cqt1992v2\"** returning frequency bin numbers?\n\nMy question is, are these two methods returning similar things? If yes, then is there a way to transform nnAudio's **\"cqt1992v2\"** output to look something similar to that of GWPy's **\"q_transform\"** (log scale on frequency maybe)? \nThanks!",
      "votes": null
    },
    {
      "id": "1490594",
      "postDate": "08/25/2021 18:01:30",
      "content": "<p> Actually, nnAudio's CQT() doesn't support frequency linear scaling.</p>",
      "rawMarkdown": "~~nnAudio's CQT() doesn't support frequency log scaling - you'll have to modify the original code.~~ Actually, nnAudio's CQT() doesn't support frequency linear scaling.",
      "votes": null
    },
    {
      "id": "1490620",
      "postDate": "08/25/2021 18:21:03",
      "content": "<p>Thanks for your reply. So is log scaling of frequency axis the the only difference between the two?</p>",
      "rawMarkdown": "Thanks for your reply. So is log scaling of frequency axis the the only difference between the two?",
      "votes": null
    },
    {
      "id": "1490669",
      "postDate": "08/25/2021 19:08:57",
      "content": "<blockquote>\n  <p>nnAudio's CQT() doesn't support frequency log scaling</p>\n</blockquote>\n<p>It's the opposite, it does not support linear frequency scale.  It uses a log scale.</p>",
      "rawMarkdown": "> nnAudio's CQT() doesn't support frequency log scaling\n\nIt's the opposite, it does not support linear frequency scale.  It uses a log scale.",
      "votes": null
    },
    {
      "id": "1490730",
      "postDate": "08/25/2021 20:13:14",
      "content": "<p>I've checked the code, and you are right. Thanks for pointing out my mistake.</p>",
      "rawMarkdown": "I've checked the code, and you are right. Thanks for pointing out my mistake.",
      "votes": null
    },
    {
      "id": "1491799",
      "postDate": "08/26/2021 16:25:37",
      "content": "<p>Thank you. Unfortunately, I am unable to upload images here to point out my doubts.<br>\nSo using nnAudio's \"cqt1992v2\" function, I get a spectogram that seems to have features on the extremes of the time axis. Is there some kind of reflection involved?</p>",
      "rawMarkdown": "Thank you. Unfortunately, I am unable to upload images here to point out my doubts.\nSo using nnAudio's \"cqt1992v2\" function, I get a spectogram that seems to have features on the extremes of the time axis. Is there some kind of reflection involved?",
      "votes": null
    },
    {
      "id": "1494851",
      "postDate": "08/29/2021 06:06:09",
      "content": "<p>FYI. nnAudio doens't support in TPU :(</p>",
      "rawMarkdown": "FYI. nnAudio doens't support in TPU :(",
      "votes": null
    },
    {
      "id": "1494966",
      "postDate": "08/29/2021 07:49:15",
      "content": "<p>Regarding the images upload (which is very annoying but I guess Kaggle is working on an improvement), you can use this service: <a href=\"https://imgbb.com/\" target=\"_blank\">https://imgbb.com/</a>. Very easy to use and it gives you a link to your image.</p>",
      "rawMarkdown": "Regarding the images upload (which is very annoying but I guess Kaggle is working on an improvement), you can use this service: https://imgbb.com/. Very easy to use and it gives you a link to your image.",
      "votes": null
    },
    {
      "id": "1494983",
      "postDate": "08/29/2021 07:59:16",
      "content": "<p>Regarding the visual aspect, I think I see what you mean. Indeed, it seems there is some wrapping around the end of the plot for nnAudio's CQT function. I will explore the function's output further and post what I find.</p>\n<p>By the way, notice that the links you have provided aren't correctly formatted: when clicking on them they lead to the main competition page. </p>",
      "rawMarkdown": "Regarding the visual aspect, I think I see what you mean. Indeed, it seems there is some wrapping around the end of the plot for nnAudio's CQT function. I will explore the function's output further and post what I find.\n\nBy the way, notice that the links you have provided aren't correctly formatted: when clicking on them they lead to the main competition page.",
      "votes": null
    },
    {
      "id": "1495079",
      "postDate": "08/29/2021 09:43:01",
      "content": "<p>Thanks for confirming the suspected wrapping. Also, fixed the URLs to the notebooks.</p>",
      "rawMarkdown": "Thanks for confirming the suspected wrapping. Also, fixed the URLs to the notebooks.",
      "votes": null
    },
    {
      "id": "1495391",
      "postDate": "08/29/2021 14:27:57",
      "content": "<p>I also tried to use nnAudio with PyTorch XLA, but it doesn't work for me as well.</p>",
      "rawMarkdown": "I also tried to use nnAudio with PyTorch XLA, but it doesn't work for me as well.",
      "votes": null
    },
    {
      "id": "1495432",
      "postDate": "08/29/2021 14:56:35",
      "content": "<p>Awesome! yes, the two outputs aren't the same for sure so will need some investigation. 👀</p>",
      "rawMarkdown": "Awesome! yes, the two outputs aren't the same for sure so will need some investigation. 👀",
      "votes": null
    },
    {
      "id": "1561066",
      "postDate": "10/27/2021 09:53:56",
      "content": "<p>Hey All,</p>\n<p>Thank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey <a href=\"https://forms.gle/QP9L16niPexozyhu5\" target=\"_blank\">https://forms.gle/QP9L16niPexozyhu5</a>.</p>\n<p>Thank you all,</p>\n<p>Regards,<br>\nChris</p>",
      "rawMarkdown": "Hey All,\n\nThank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey https://forms.gle/QP9L16niPexozyhu5.\n\nThank you all,\n\nRegards,\nChris",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1490594,
      "author_name": "atamazian",
      "author_url": "",
      "post_date": "08/25/2021 18:01:30",
      "content": "<p> Actually, nnAudio's CQT() doesn't support frequency linear scaling.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1490620,
          "author_name": "sbpdev",
          "author_url": "",
          "post_date": "08/25/2021 18:21:03",
          "content": "<p>Thanks for your reply. So is log scaling of frequency axis the the only difference between the two?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1490669,
          "author_name": "cpmpml",
          "author_url": "",
          "post_date": "08/25/2021 19:08:57",
          "content": "<blockquote>\n  <p>nnAudio's CQT() doesn't support frequency log scaling</p>\n</blockquote>\n<p>It's the opposite, it does not support linear frequency scale.  It uses a log scale.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1490730,
          "author_name": "atamazian",
          "author_url": "",
          "post_date": "08/25/2021 20:13:14",
          "content": "<p>I've checked the code, and you are right. Thanks for pointing out my mistake.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1491799,
          "author_name": "sbpdev",
          "author_url": "",
          "post_date": "08/26/2021 16:25:37",
          "content": "<p>Thank you. Unfortunately, I am unable to upload images here to point out my doubts.<br>\nSo using nnAudio's \"cqt1992v2\" function, I get a spectogram that seems to have features on the extremes of the time axis. Is there some kind of reflection involved?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1494966,
          "author_name": "yassinealouini",
          "author_url": "",
          "post_date": "08/29/2021 07:49:15",
          "content": "<p>Regarding the images upload (which is very annoying but I guess Kaggle is working on an improvement), you can use this service: <a href=\"https://imgbb.com/\" target=\"_blank\">https://imgbb.com/</a>. Very easy to use and it gives you a link to your image.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1494983,
          "author_name": "yassinealouini",
          "author_url": "",
          "post_date": "08/29/2021 07:59:16",
          "content": "<p>Regarding the visual aspect, I think I see what you mean. Indeed, it seems there is some wrapping around the end of the plot for nnAudio's CQT function. I will explore the function's output further and post what I find.</p>\n<p>By the way, notice that the links you have provided aren't correctly formatted: when clicking on them they lead to the main competition page. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1495079,
          "author_name": "sbpdev",
          "author_url": "",
          "post_date": "08/29/2021 09:43:01",
          "content": "<p>Thanks for confirming the suspected wrapping. Also, fixed the URLs to the notebooks.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1495432,
          "author_name": "yassinealouini",
          "author_url": "",
          "post_date": "08/29/2021 14:56:35",
          "content": "<p>Awesome! yes, the two outputs aren't the same for sure so will need some investigation. 👀</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1494851,
      "author_name": "leemop",
      "author_url": "",
      "post_date": "08/29/2021 06:06:09",
      "content": "<p>FYI. nnAudio doens't support in TPU :(</p>",
      "votes": null,
      "replies": [
        {
          "id": 1495391,
          "author_name": "atamazian",
          "author_url": "",
          "post_date": "08/29/2021 14:27:57",
          "content": "<p>I also tried to use nnAudio with PyTorch XLA, but it doesn't work for me as well.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1561066,
      "author_name": "zerafachris",
      "author_url": "",
      "post_date": "10/27/2021 09:53:56",
      "content": "<p>Hey All,</p>\n<p>Thank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey <a href=\"https://forms.gle/QP9L16niPexozyhu5\" target=\"_blank\">https://forms.gle/QP9L16niPexozyhu5</a>.</p>\n<p>Thank you all,</p>\n<p>Regards,<br>\nChris</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1490497": "I was going through some of the discussions and fantastic notebooks here, like: \n[https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta](https://www.kaggle.com/andradaolteanu/g2net-searching-the-sky-pytorch-effnet-w-meta)\nand [https://www.kaggle.com/mistag/data-preprocessing-with-gwpy](https://www.kaggle.com/mistag/data-preprocessing-with-gwpy)\n\nFrom these, I understand that nnAudio's **\"cqt1992v2\"** method is much faster by comparison. However, I find the CQT image from GWPy's **\"q_transform\"** method to be more interpretable to visualize a potential event. Is the y-axis of nnAudio's **\"cqt1992v2\"** returning frequency bin numbers?\n\nMy question is, are these two methods returning similar things? If yes, then is there a way to transform nnAudio's **\"cqt1992v2\"** output to look something similar to that of GWPy's **\"q_transform\"** (log scale on frequency maybe)? \nThanks!",
    "1490594": "~~nnAudio's CQT() doesn't support frequency log scaling - you'll have to modify the original code.~~ Actually, nnAudio's CQT() doesn't support frequency linear scaling.",
    "1490620": "Thanks for your reply. So is log scaling of frequency axis the the only difference between the two?",
    "1490669": "> nnAudio's CQT() doesn't support frequency log scaling\n\nIt's the opposite, it does not support linear frequency scale.  It uses a log scale.",
    "1490730": "I've checked the code, and you are right. Thanks for pointing out my mistake.",
    "1491799": "Thank you. Unfortunately, I am unable to upload images here to point out my doubts.\nSo using nnAudio's \"cqt1992v2\" function, I get a spectogram that seems to have features on the extremes of the time axis. Is there some kind of reflection involved?",
    "1494851": "FYI. nnAudio doens't support in TPU :(",
    "1494966": "Regarding the images upload (which is very annoying but I guess Kaggle is working on an improvement), you can use this service: https://imgbb.com/. Very easy to use and it gives you a link to your image.",
    "1494983": "Regarding the visual aspect, I think I see what you mean. Indeed, it seems there is some wrapping around the end of the plot for nnAudio's CQT function. I will explore the function's output further and post what I find.\n\nBy the way, notice that the links you have provided aren't correctly formatted: when clicking on them they lead to the main competition page.",
    "1495079": "Thanks for confirming the suspected wrapping. Also, fixed the URLs to the notebooks.",
    "1495391": "I also tried to use nnAudio with PyTorch XLA, but it doesn't work for me as well.",
    "1495432": "Awesome! yes, the two outputs aren't the same for sure so will need some investigation. 👀",
    "1561066": "Hey All,\n\nThank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey https://forms.gle/QP9L16niPexozyhu5.\n\nThank you all,\n\nRegards,\nChris"
  },
  "source": "meta"
}