segmentation fault when using pvsceps
Date | 2016-07-25 10:33 |
From | Karin Daum |
Subject | segmentation fault when using pvsceps |
Hi, I wanted to use pvsceps to try some pattern recognition on voices. Including pvsceps in my code produces segmentation faults both when running in CsoundQT 0.9.2.1 or when running Csound 6.07 on the terminal. I verified that the same problem exists when using the pvsceps.csd example (example 706) from the manual. what kind of values do I expect for keps[] from the line keps[] pvsceps fsig ? when trying to print them with printk2 I only get NANs. How are the coefficients in keps[] related to 1/f of the frequencies you can retrieve via kflag pvsftw fsig,ifftAmps,ifftFreq? cheers, Karin Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-07-25 12:54 |
From | jpff |
Subject | Re: segmentation fault when using pvsceps |
Cannot reproduce from pvsceps.csd on Linux On Mon, 25 Jul 2016, Karin Daum wrote: > Hi, > > I wanted to use pvsceps to try some pattern recognition on voices. Including pvsceps in my code produces segmentation faults both when running in CsoundQT 0.9.2.1 or when running Csound 6.07 on the terminal. > > I verified that the same problem exists when using the pvsceps.csd example (example 706) from the manual. > > what kind of values do I expect for keps[] from the line > > keps[] pvsceps fsig ? > > when trying to print them with printk2 I only get NANs. > > How are the coefficients in keps[] related to 1/f of the frequencies you can retrieve via > > kflag pvsftw fsig,ifftAmps,ifftFreq? > > cheers, > > Karin > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-07-25 12:59 |
From | jpff |
Subject | Re: segmentation fault when using pvsceps |
on the oter hand using valgrind ==10758== Invalid read of size 8 ==10758== at 0x4F34C1A: perf_iceps (arrays.c:1864) ==10758== by 0x4FA090D: kperf_nodebug (csound.c:1558) ==10758== by 0x4FA1EFD: csoundPerform (csound.c:2051) ==10758== by 0x40158B: main (csound_main.c:318) ==10758== Address 0x19152b40 is 0 bytes after a block of size 4,112 alloc'd ==10758== at 0x4C2B200: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==10758== by 0x4E8DAD7: mcalloc (memalloc.c:113) ==10758== by 0x4E75D32: csoundAuxAlloc (auxfd.c:53) ==10758== by 0x4F38579: init_iceps (arrays.c:1851) ==10758== by 0x4E8AF28: insert (insert.c:300) ==10758== by 0x4E8F815: process_score_event (musmon.c:768) ==10758== by 0x4E91E3C: sensevents (musmon.c:962) ==10758== by 0x4FA1F0D: csoundPerform (csound.c:2042) ==10758== by 0x40158B: main (csound_main.c:318) ==10758== migt relae On Mon, 25 Jul 2016, Karin Daum wrote: > Hi, > > I wanted to use pvsceps to try some pattern recognition on voices. Including pvsceps in my code produces segmentation faults both when running in CsoundQT 0.9.2.1 or when running Csound 6.07 on the terminal. > > I verified that the same problem exists when using the pvsceps.csd example (example 706) from the manual. > > what kind of values do I expect for keps[] from the line > > keps[] pvsceps fsig ? > > when trying to print them with printk2 I only get NANs. > > How are the coefficients in keps[] related to 1/f of the frequencies you can retrieve via > > kflag pvsftw fsig,ifftAmps,ifftFreq? > > cheers, > > Karin > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-07-25 14:16 |
From | Karin Daum |
Subject | Re: segmentation fault when using pvsceps |
I’m on mac OSX 10.10.5. using Csound 6.07 64 bit copy & paste from the terminal: =mbp-kd-2:/x01/usr/daum/Csound 15:13> Csound -d pvsceps.csd virtual_keyboard real time MIDI plugin for Csound WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH (points to rawwaves directory) to use STK opcodes. 0dBFS level = 32768.0 Csound version 6.07 (double samples) May 16 2016 libsndfile-1.0.21 WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjacko.dylib' (-1) WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjackTransport.dylib' (-1) WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/librtjack.dylib' (-1) UnifiedCSD: pvsceps.csd STARTING FILE Creating options Creating orchestra Creating score WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH (points to rawwaves directory) to use STK opcodes. rtaudio: PortAudio module enabled ... using callback interface rtmidi: PortMIDI module enabled Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s sorting score ... ... done Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s --Csound version 6.07 (double samples) May 16 2016 displays suppressed 0dBFS level = 1.0 orch now loaded audio buffered in 1024 sample-frame blocks writing 4096-byte blks of shorts to test.aif (AIFF) SECTION 1: new alloc for instr 1: diskin2: opened 'fox.wav': 44100 Hz, 1 channel(s), 121569 sample frames B 0.000 .. 60.000 T 60.000 TT 60.000 M: 0.00000 0.00000 Score finished in csoundPerform(). csound command: Segmentation fault =mbp-kd-2:/x01/usr/daum/Csound 15:14> > On 25 Jul 2016, at 13:54, jpff |
Date | 2016-07-27 04:14 |
From | Steven Yi |
Subject | Re: segmentation fault when using pvsceps |
Hi Karin, >From what I understand, pvsceps should give you the real cepstrum derived from the fsig. cepsinv should then be used with the results of pvsceps to get the spectral envelope. The code for pvsceps is found at: https://github.com/csound/csound/blob/develop/Opcodes/arrays.c#L1760-L1803 and is similar to: ceps = fft(log(abs(fft(sig)) which is then liftered if the option is given to remove coefficients. cepsinv would then do something like: spectrum = exp(ifft(ceps)) to get the smoothed spectrum. (The above as pseudo-matlab code.) I used a printks with lenarray and it shows the length of the array as 513 for the pvsceps.csd. The window size for the fsig is 1024, which would give 512 positive and 512 negative frequencies. The cesptrum is analysed from the magnitudes of the positive frequencies (512). The additional value is... what I'm forgetting, but I think it's the value for the Nyquist frequency... Well, that's what I understand at least. (I think this is the cue where Victor comes in and corrects me. ;) ) As a side note, I'm not getting crashes here on Windows 64-bit, but I'm using the latest from the develop branch. Hope that's useful! steven On Mon, Jul 25, 2016 at 5:33 AM, Karin Daum |
Date | 2016-07-27 14:38 |
From | Karin Daum |
Subject | Re: segmentation fault when using pvsceps |
Hi Steven, thank you for your explanation and the reference to the source. This seems to be what I was missing for relating the cepstrum coefficients to 1/freq from what I can get via pvsftw. apart from the segmentation fault (for which John found the reason) I have the problems when printing the coefficients with printks2 I only get nans. cheers, Karin > On 27 Jul 2016, at 05:14, Steven Yi |
Date | 2016-07-27 14:43 |
From | jpff |
Subject | Re: segmentation fault when using pvsceps |
On Wed, 27 Jul 2016, Karin Daum wrote: > Hi Steven, > > thank you for your explanation and the reference to the source. This > seems to be what I was missing for relating the cepstrum coefficients to > 1/freq from what I can get via pvsftw. > > apart from the segmentation fault (for which John found the reason) I > have the problems when printing the coefficients with printks2 I only > get nans. Do you have a simple example where you get NaNs? I can look at it then ==John Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-07-27 17:45 |
From | Karin Daum |
Subject | Re: segmentation fault when using pvsceps |
here it is: |
Date | 2016-07-27 18:03 |
From | jpff |
Subject | Re: segmentation fault when using pvsceps |
I see no NaNs -- just some junk afte " next kontrol cycle 1 " #is that the other bug? On Wed, 27 Jul 2016, Karin Daum wrote: > here it is: > > |
Date | 2016-07-27 18:14 |
From | Karin Daum |
Subject | Re: segmentation fault when using pvsceps |
> On 27 Jul 2016, at 19:03, jpff |
Date | 2016-07-27 18:15 |
From | jpff |
Subject | Re: segmentation fault when using pvsceps |
Kixed the printks2 problem -- just checking it in On Wed, 27 Jul 2016, Karin Daum wrote: > here it is: > > |