Discrete Wavelet Transform C++ Implementation - Run time error

1k views Asked by At

I am looking for some help using the Discrete Wavelet Transform (DWT) Library found here: wavelet2d.sourceforge.net/

The trouble is a run time error, which occurs at the DWT function call. It seems to be associated with the length vector in the function call. I want to note that this code was published as is and was reported working by a post doctorate from MIT. Im pretty sure this error is due to something I am doing incorrectly. I created a project file for Microsoft Visual Studio 2013 which I have included here: skydrive.live.com/redir?resid=DF1EA4AE66DE04A3%21128

Note: I placed the two dll files in the system32 folder and the .lib file is included in the MSVC++ Project file which links to the dll’s. I used the release dll's but i get the same result with the debug files. The signal.txt is used by the wavedem1.cpp project file and is operated on.

The error can be easily generated but here is the unhandled exception I am getting: “Unhandled exception at 0x7555D36F in WaveletCode.exe: Microsoft C++ exception: std::length_error at memory location 0x002EF574.”

Here is the call stack: http://img198.imageshack.us/img198/4306/9jdl.jpg It looks like line 65 is causing an issue which is the DWT function call. I tried to look at the "intermediate window" in MSVC++ 2013 but it was empty during execution.

And some more from MSVC++:

'WaveletCode.exe' (Win32): Loaded 'C:\Users\Matt\Desktop\WaveletCode\Debug\WaveletCode.exe'. Symbols loaded.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\wavelet2d.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\libfftw3-3.dll'. Module was built without symbols.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\msvcp100d.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\msvcr100d.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\msvcp120d.dll'. Cannot find or open the PDB file.
'WaveletCode.exe' (Win32): Loaded 'C:\Windows\System32\msvcr120d.dll'. Cannot find or open the PDB file.
First-chance exception at 0x644921A9 (wavelet2d.dll) in WaveletCode.exe: 0xC0000005: Access violation reading location 0x9F8ED620.
Unhandled exception at 0x644921A9 (wavelet2d.dll) in WaveletCode.exe: 0xC0000005: Access violation reading location 0x9F8ED620.
The program '[5532] WaveletCode.exe' has exited with code 0 (0x0).

The end goal is to use this library on a micro-controller for some DSP. Thank you for any help/suggestions you can provide. If you need more information please ask I am relatively new to this.

Thank You.

1

There are 1 answers

4
Aaron On

I don't have VS 2013 in order to try this, but at least one problem I see is that your wavelet library imports the MSVCR100.dll standard library (from VS 2010), whereas your application imports MSVCR120D.dll (from VS 2013). Since you are passing standard library objects (vectors) between the two, that could be your problem as they aren't guaranteed to be compatible.