zapline-plus icon indicating copy to clipboard operation
zapline-plus copied to clipboard

find_next_noisefreq finds no noisefreq

Open ksgfan opened this issue 2 years ago • 3 comments

Hi,

The problem starts in clean_data_with_zapline_plus.m (323). find_next_noisefreq finds no noisefreq, which results in length(noisefreqs) being 0. Consequently, the while loop is never entered and data not cleaned. Finally, cfg.f_noise = f_noise; throws an error, because f_noise is not defined (its defined only within the while loop).

Best, Dawid

ksgfan avatar Jan 20 '23 09:01 ksgfan

Hi Dawid,

thanks for checking out Zapline-plus! I cannot find the line cfg.f_noise = f_noise;, could you point me to where exactly this happens?

Cheers, Marius

MariusKlug avatar Apr 14 '23 10:04 MariusKlug

Hi Marius,

thanks for the response! The cfg.f_noise = f_noise; was my custom code, that's why you cannot find it : )

Nevertheless, for some data files the find_next_noisefreq does not find a noisefreq, which results in line noise being not removed.

Best, Dawid

ksgfan avatar Apr 14 '23 11:04 ksgfan

If find_next_noisefreqs does not find noisefreqs, but you think there is something that should be removed, you can either specify that noisefreq manually or you can lower the detector threshold so it is more sensitive. But yeah, if it does not have one, then it also cannot give you a frequency, of course. zaplineConfig.noisefreqs will then be [], so you may be able to assign that nonetheless to your results, depending on how you store it.

Cheers

MariusKlug avatar Apr 14 '23 14:04 MariusKlug