Friday, February 13, 2009

fWIIne v0.3 - workaround for spectrogram example

[english version]
fWIIne v0.3 - a workaround for the spectrogram example and an estimation of distance from sensor bar

As some fwiine users have already reported, the new version 0.3 has a different behavior from the previous one. Unfortunately, some problems occurred with the file "fwiine_accel_fft_wiimote.m" (example for spectrogram from Wiimote's accelerometer values).
Before delivering a new release, this post will provide you a workaround. Then you will find an application of Wiimote InfraRed sensor : estimation of distance from sensor bar.
And finally, you will find some solutions to solve failures at fWIIne installation with MATLAB and Windows XP.

1. fwiine_accel_fft_wiimote.m - latest update here

The library fWIIne inherited some "unexpected" features from the library wiiuse (and from tutorial example, too). As for example, rumble is enabled/disabled by pressing button B. Unfortunately, some problems also occurred : first accelerometer values are unavailable and take the value "Inf".
So the m. file failed. Then you will find the latest and corrected version for "fwiine_accel_fft_wiimote.m" , here.
[Spectrogram from an experiment with a subwoofer delivering a 10Hz pulse - aZ(pulse)=10Hz Ok]
stimuli "10Hz pulse" : .wav file


2. Distance from sensor bar (wireless sensor bar)

An estimation of distance from sensor bar takes in consideration the distance between 2 IR dots : IR1(x1,y1) and IR2(x2,y2). The relation between distance d (d=IR1 IR2) and position z (z = distance between wiimote and sensor bar) can be understood as : d = zf*k/z
[description of the experiment with a wiimote and a wireless sensor bar]

The following result was observed with several measurements :
[d=f(z) / 2 kinds of recordings according to acquisition from IR sensor]

The measures underline the impact of resolution of the IR sensor. For z under 60cm, the sensor bar is able to distinguish LEDs on the left (or right) side of the sensor bar. According to selected LED and wii controller orientation, 2 different measures of d can be recorded for one position z, eventually. So we face to a lack of robustness of this kind of measure, here. To conclude about this subject, a reversed-engineered solution for z is available, considering potential values of d. Source : (Wiimoteproject's forum) distance from sensor bar



3. Troubleshooting with fWIIne.mexw32 and MATLAB for Windows XP
[Special thanks to Tzahi Menashe for supporting the installation tests !]

On a failure occurrence with installation of MEX library, the problem can be caused by several reasons :

- Your current Matlab release : You need to recompile the program with the Matlab libraries of the Matlab you intend to use. (Matlab compatibility : up to r2007a 7.1 - fWIIne release note )
- VS runtime libraries (already explained, here. fWIIne Manual)
- Compiler compatibility : In a Matlab command window, the following commands might help:
> mex -setup
> mbuild -setup
> rtwintgt -install

you'll then need to choose the compiler that was used to build the program. fWIIne is built with Visual Studio Exp. edition so a selection of the compiler visual studio c++ will be compatible. Of course, you will have to install Visual C++ on your computer.

1 comment:

mygamebest said...
This comment has been removed by a blog administrator.