Digital Signal Processing Reference
In-Depth Information
(e) Right click on the class CRtdx _ vc _ fftMatlabDlg and select Add Windows
Message Handler . Find and select the message WM _ DESTROY , and click
on Add and Edit to insert the new windows message. Add the following
lines of code beneath the function CDialog::OnDestroy( ):
nFlag 0;
WaitForSingleObject(pRTDXThread-> m_hThread, INFINITE);
=
(f) Right-click on the class CRtdx _ vc _ fftMatlabDlg and click on Add member
function . For the type, use UINT and for the declaration, type static
RTDXThreadFunction(LPVOID lpVoid) and then click OK.
(g) Expand the class CRtdx _ vc _ fftMatlabDlg , double-click on the member
function RTDXThreadFunction(LPVOID lpVoid) , and add the following
lines of code in the function body (between the pair of brackets):
CMatlabClass* pMatlab;
IRtdxExp *pRtdx;
...
pMatlab
-
>
ExecuteLine
(_T( fs = 16e3; ));
...
pMatlab
-
>
ExecuteLine
(_T( plot(fp, fftMag(129: 256)) ));
...
return 0;
Scroll to the top of the file and add the following two include files and the
global variable nflag :
#
include
MatlabClass h
.
#
include
Rtdx
int.h
int nFlag
=
1;
(h) With the class CRtdx _ vc _ fftMatlabDlg expanded, double-click on the
member function OnInitDialog( ) and add the following line of code just
before the return instruction:
pRTDXThread
=
(CRTDXThread*)AfxBeginThread
(RTDXThreadFunction,m_hWnd);
7. The path of MATLAB libraries and include files need to be added before
building the project. Select Tools
Options to display the Options dialog, and
click on the Directories tab. Select the Include File s item from Show directo-
Æ
Search WWH ::




Custom Search