ahof1704 / VocalMat

Analysis of ultrasonic vocalizations from mice using computer vision and machine learning
https://www.dietrich-lab.org/vocalmat
Apache License 2.0
21 stars 9 forks source link

Parameters unclear #23

Closed idala03 closed 2 months ago

idala03 commented 3 months ago

Hello! I'm having an issue using VocalMat to process my wave file. The sample file works fine! I continue to get error messages related to the vocalmat_identifier.m script (specifically around the time it removes small vocalizations). Do you have any advice? The sampling size for my file is 250 kHz, as suggested; it has a shorter duration, one channel, and with less total samples than the example. Our files do not have that much background noise. Could that be the issue? What are your suggestions for modifying preprocessing steps or changing parameters in the code? Thank you so much!

ahof1704 commented 3 months ago

What is the error you are getting?

Are you sure that the recording has any vocalizations in it? The spectrogram you shared on the other thread looks quite silent. I also noticed that you have quite a lot of constant high-frequency noise. Unfortunately, VocalMat is not very good at accounting for this type of noise.

idala03 commented 3 months ago

Thank you very much for your response! The errors I'm getting are the following:

Operation terminated by user during vocalmat_identifier (line 377)

In run (line 112) evalin('caller', strcat(scriptStem, ';'));

In VocalMat (line 99) cd(fullfile(root_path, 'audios')); run('vocalmat_identifier.m')

I think it's stuck in a loop because I have to stop the code. Also, the data I am using is for mouse pups, and their vocalizations are typically between 5-95 kHz. Perhaps the code cannot account for that range. Is there a way I might be able to modify the code myself to accommodate for that difference? I have checked the file for vocalizations, and they are present, but they last only a few ms, so that could also contribute to the issue. Do you think it would be possible to filter the high-frequency noise with a low-pass filter? Thanks again!

ahof1704 commented 3 months ago

Here are a few questions:

[1] https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0017460

idala03 commented 3 months ago

Thank you so much for all of the tips! I tried a different audio file, and it worked much better—I think there was an issue with that particular file. I am also cutting off vocalizations shorter than 10 ms and would love to modify the code to only include USVs with 10 ms separating two vocalizations. We are working with mouse pups who have hypoxic ischemia, and we will reconsider our vocalization range! I really appreciate all of the resources you are providing.

idala03 commented 3 months ago

I believe I can manage from here on out—thanks again! I have one more question if you don't mind. The command window records the number of vocalizations and the number that were counted but are just noise. Is it possible to modify the Excel file/the output file to ensure it only includes these "real" vocalizations?

ahof1704 commented 3 months ago

I think the easiest way would be to filter the Excel file afterwards, in a post-processing step. You could do it either on Matlab or directly on Excel.