Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encountering problems with MATLAB code #2

Open
twilight-kk opened this issue Sep 14, 2024 · 4 comments
Open

Encountering problems with MATLAB code #2

twilight-kk opened this issue Sep 14, 2024 · 4 comments

Comments

@twilight-kk
Copy link

I used the code and signals provided by the blogger to run HPSS. m, and the h and p components I obtained were abnormal, especially the first few values, which were very large. What is the reason for the abnormality?

@sevagh
Copy link
Owner

sevagh commented Sep 14, 2024

I would guess dividing by small numbers when there's not enough data, or a lot of silence. What type of audio/signal are you using?

@twilight-kk
Copy link
Author

Yes, you are right. I later discovered that the input signal was incorrect. I replaced it with a new mixed signal and also used my own .wav audio signal, and it was possible to separate it normally.

However, when I plotted the spectra of the separated harmonic (h) and percussive (p) components, I found that their spectra were abnormal. Therefore, I modified the HPSS.m script where win = sqrt(hann(winLen, "periodic")) was used, changing it to win = hann(winLen, "periodic") and also tried using Hamming windows. This adjustment made the spectra look normal, but the amplitude of the h and p in the time domain decreased significantly, meaning their intensity was reduced. Is this a problem related to the total energy change? I am still a bit confused about this issue and would appreciate your advice on how to resolve it. Looking forward to your response!

@sevagh
Copy link
Owner

sevagh commented Sep 15, 2024

What does an abnormal spectrum look like? You can post the spectrum here, or the audio file if possible.

@twilight-kk
Copy link
Author

Thank you for your reply. I am Chinese and currently celebrating the traditional Mid-Autumn Festival, so I have not been able to go to the lab these days and cannot send you the anomaly spectrum in a timely manner. I apologize for the inconvenience. I will send it to you after September 18th, which is Wednesday. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants