Смекни!
smekni.com

Разработка программного обеспечения для голосового управления трехмерными моделями функционирования промышленных роботов (стр. 16 из 17)


Перечень ссылок

1. Рабинер Л. Р., Шафер Р. В. Цифровая обработка речевых сигналов: Пер. с англ./Под ред. М. В. Назарова и Ю. Н. Прохорова. - М.: Радио и связь, 1981.-496 с.

2. Рабинер Л. Р., Гоулд Б. Теория и применение цифровой обработки сигналов: Пер. с англ./Под ред. Александрова Ю. Н. - М.: Мир, 1978. -848 с.

3. А. V. Oppenhehn and R. W. Schafer, Digital Signal Processing,, Prentice-Hall, Inc., Englewood Cliffs, N.J., 1975. - 436 p.

4. A. Peled and B. Liu, Digital Signal Processing. Theory, Design and Implementation, John Wiley and Sons.New York, 1976. - 675 p.

5. J. W. Cooley and J. W. Tukey, "An Algorithm for the Machine Computation of Complex Fourier.Series," Math Computation, Vol. 19, 1965. - 452 p.

6. Бондарев В. H., Трёстер Г., Чернега В. С. Цифровая обработка сигналов: методы и средства. Учеб. Пособие для вузов. 2-е изд. - X.: Конус, 2001. -398 с.

7. Марпл С. Л. Цифровой спектральный анализ и его приложения. - М.: Мир, 1990.-584 с.

8. Бендат Дж., Пирсол А. Применения корреляционного и спектрального анализа. -М.: Мир, 1983. -312 с.

9. Гольденберг Л. М., Матюшкин Б. Д., Поляк М. Н. Цифровая обработка сигналов: Справочник. -М.: Радио и связь, 1985. - 312 с.

10. Гутников В. С. Фильтрация измерительных сигналов. - Л.: Энергоатомиздат, Ленингр. отд-ние, 1990. - 192 с.

11. J. Н. McClellan, Т. W. Parks, and L. R. Rabiner, "A Computer Program for Designing Optimum FIR Linear Phase Digital Filters," IEEE Trans. Audio and Electro acoustics, Vol. AU-21, 1973. - 347 p.

12. Цифровые фильтры в электросвязи и радиотехнике/ А. В. Брунченко, Ю.Г. Бутыльский, Л. М. Гольденберг и др.: под ред. Л. М. Гольденберга.

- M.: радио и связь, 1982. - 224 с.

13. J. L. Ftanagan, С. H. Coker, L. R. Rabiner, R. W. Schafer, and N. Umeda, "Synthetic Voices for Computers," IEEE Spectrum, Vol. 7, No. 10, October 1970.-536 p.

14. MFC и Visual С++. Энциклопедия программиста: Пер. с англ./ Юджин Олафсен, Кенн Скрайбнер, К. Дэвид Уайт и др. - СПб.: ООО «ДиаСофтЮП», 2004. - 992с.

15. Шилдт Герберт. MFC: основы программирования. - К.: Издательская группа BHV, 1997. - 560 с.

16. Тихомиров Ю.В. OpenGL. Программирование трехмерной графики. -СПб.: БХВ-Петербург, 2002.-304 с.

17. OpenGL. Официальное руководство программиста: Пер. с англ. / Мейсон By, Джеки Нейдер, Том Девис, Дейв Шрайнер. - СПб: ООО «ДиаСофтЮП», 2002. - 592 с.


Приложение А. Элементы текстов программного кода

// recorddlh: header file class CRecordDlg;

class CRecDlgNotifyObj: public CWaveNotifyObj {public:

CRecDlgNotifyObjO; -CRecDlgNotifyObjO; void Attach(CRecordDlg* pDlg) {m_pDlg = pDlg;}

virtual void NewData(CWave *pWave, CWaveBIock* pBlock);

virtual void EndPlayback(CWave *pWave);

CRecordDlg* m_pDlg;};

class CFilterDlg. public CDialog

{public. CWaveOutDevice* m_pOutDev;

CFilterDlg(CWnd* pParent = NULL);

enum { IDD= IDD_FILTERDLG };

protected:

virtual void DoDataExchange(CDataExchange* pDX); protected:

afxmsg void OnFilter(); DECLAREMESSAGEMAPOJ; class CRecordDlg: public CDialog {public:

CRecordDlg(CWnd* pParent = NULL); ~CRecordDlg();

void NewData(CWave *pWave, CWaveBIock* pBlock);

void EndPlayback(CWave *pWave);

enum { IDD = IDD_RECORDDLG };

CButtonmbtnOpenData;

CComboBox mcbSource;

CComboBox mcbFormat;

CStatic mwndFrame;

CButton mbtnPause;

CButton mbtnPlay;

CButton mbtnRecord;

CButton mbtnOK;

CButton mbtnStop;

CString mstrFormat;

CString m_strSource;

public:

void UDdatdTJClientDC *curDC>:

CFilterDIg* m_pFUter; CWave* m_pWave; private:

enum MODE {IDLE, SAMPLING,PLAYTNG,RECORDING,OPEN };

CVUMeter m_VU;

int mJNumDevs;

WAVEINCAPS* m_pDevCaps;

CWavelnDevice mlnDev;

CWave mSampleWave;

CRecDlgNotifyObj m_NotifyObj;

int mJMode;

void FillDeviceList();

void FillFormatListQ;

void SetMode(MODE m);

void BuildFormat(PCMWAVEFORMAT& fmt, DWORD dwFormat); protected:

virtual void DoDataExchange(CDataExchange* pDX);

virtual BOOL OnlnitDialogO;

afxmsg void OnSelchangeFormat();

afxmsg void OnClickedPlay();

afxjmsg void OnClickedRecordO;

afxmsg void OnClickedStop();

afxmsg void OnSelchangeSource();

virtual void OnCancel();

virtual void OnOK();

afxmsg void OnDrawItem(int nlDCtl, LPDRAW1TEMSTRUCT IpDrawItemStruct); afxmsg void OnMeasureItem(int rJDCtl, LPMEASUREITEMSTRUCT IpMeasureltemStruct); afxmsg void OnClickedOpenData(); afxmsg void OnUpdate();

afxmsg void OnHScroll(UTNT nSBCode, UINT nPos, CScrollBar* pScrollBar);

afx_msg void OnGraphicQ;

afxmsg void OnHamming();

afxmsg void OnFilterQ;

afxmsg void OnFurjeQ;

afx_msg void OnObrfurje();

afxmsg void OnClip();

DECLARE_MESSAGE_MAP()};

class CGraphicDlg: public CDialog

{public:

CWaveOutDevice* mjOutDev; CGraphicDlg(CWnd* pParent = NULL); enum { IDD = IDD GRAPHIC };

protected:

virtual void DoDataExchange(CDataExchange* pDX); protected:

afxmsg void OnGraphicQ; DECLAREMESS AGE_MAP()}; class CHammingDlg: public CDialog {public:

CWaveOutDevice* m_pOutDev; CHammingDlg(CWnd* pParent = NULL); enum {IDD = IDD HAMMING }; protected:

virtual void DoDataExchange(CDataExchange* pDX); protected:

afxmsg void OnHammingO; DECLAREMESSAGEMAPO); class CFurjeDlg. public CDialog {public:

CWaveOutDevice* m_pOutDev; CFurjeDlg(CWnd* pParent = NULL); enum {IDD = IDDFURJE }; protected:

virtual void DoDataExchange(CDataExchange* pDX); protected:

afxmsg void OnFurjeO; DECLAREMESSAGEMAPO}; class CObrFurjeDlg: public CDialog {public:

CWaveOutDevice* m_pOutDev; CObrFurjeDlg(CWnd* pParent = NULL); enum { IDD = IDD OBRFURJE }; protected:

virtual void DoDataExchange(CDataExchange* pDX); protected:

afxmsg void OnObrfurje(); DECLAREMESSAGEMAPO}; class CClipDlg. public CDialog {public:

CWaveOutDevice* m_pOutDev; CClipDlg(CWnd* pParent = NULL); enum { IDD = EDDCLIP }; protected:

virtual void DoDataExchange(CDataExchange* pDX);

ON_BN_CLICKED(IDC_GRAPHIC, OnGraphic) ON_BN_CLICKED(IDC_HAMMrNG, OnHamming) ON_BN_CLICKED(IDC_FILTER OnFilter) ON_BN_CLICKED(IDC_FURJE, OnFurje) ON_BN_CLICKED(IDC_OBRFURJE, OnObrfurje) ON_BN_CLICKED(IDC_CLIP, OnClip) END_MESSAGE_MAP() BOOL CRecordDlg::OnInitDialog() {CDialog::OnInitDialog(); ASSERT(mjpWave = NULL); CRect rcVU;

m_wndFrame.GetWindowRect(&rcVU); ScreenToClient(&rcVU);

m_VU.Create(nVU",WS_CHILD | WS_VISIBLE,rcVU,this,l);

m_VU.SetValue(0> 0);

FillDeviceListQ;

FillFormatListO;

SetMode(SAMPLLNG);

return TRUE; }

void CRecordDlg::OnSelchangeFormatO

{OnClickedStopO;}

void CRecordDlg::OnClickedPIayO

{SetMode(PLAYING);

CClientDCdc(this);}

void CRecordDlg. OnClickedRecordO

{ SetMode(RECORDLNG);}

void CRecordDlg. OnClickedStopO

{SetMode(S AMPLING);}

void CRecordDlg::OnSelchangeSource()

{OnClickedStopO;

FillFormatListO;}

void CRecordDlg::OnCancelO

{ OnClickedStopO;

SetMode(IDLE);

mVU.DestroyWindowO;

if (m_pWave) {delete m_pWave;

m_pWave = NULL;}

CDialog::OnCancel();}

void CRecordDlg. OnOKO

{ OnClickedStopO;

SetMode(IDLE);

mVU.DestroyWindowO;

CDialog::OnOK();}

void CRecordDlg::FillDeviceList()

{miNumDevs = wavelnGetNumDevsO;

if (miNumDevs == 0) {

AfxMessageBox("There are no suitable input devices");

EndDialog(IDCANCEL);

return;}

if (m_pDevCaps) delete m_pDevCaps;

m_pDevCaps = new WAVEINCAPSfmiNumDevs];

m_cbSource.ResetContent();

for (int i=0; KmiNumDevs; i++) {

waveInGetDevCaps(i,&m_pDevCaps[i],sizeof(WAVEINCAPS)); m_pDevCaps[i].wMid = i;

m_cbSource.AddString((LPCSTR)&m_pDevCaps[i]);}

mcbSource. SetCurSel(0);}

void CRecordDlg.:FillFormatList()

{ mcbFormat.ResetContentO;

int iSel = m_cbSource.GetCurSel();

if(iSel = CBERR) return;

WAVEINCAPS* pCaps = (WAVEINCAPS*) m_cbSource.GetItemData(iSel);

ASSERT(pCaps);

DWORD dwMask = 0x00000001;

for(inti=0; i<12; i++) {

if (pCaps->dwFormats & dwMask) {

m_cbFormat.AddString((LPCSTR)dwMask);}

dwMask = dwMask « 1; }

mcbFormat. SetCurSel(O);}

void CRecordDlg.OnDrawItem(int nlDCtl, LPDRAWITEMSTRUCT pDI) {char* pszText = NULL; switch (nlDCtl) { case IDC_SOURCE: {

WAVEINCAPS* pCaps = (WAVEINCAPS*)(pDI->itemData); pszText = pCaps->szPname; } break;

case IDC FORMAT: { switch(pDI->itemData) { case WAVE_FORMAT_1M08: pszText = "11.025 kHz, 8 bit, mono"; break;

case WAVE_FORMAT_1S08: pszText = "11.025 kHz, 8 bit, stereo"; break;

case WAVE_FORMAT_lM16: pszText = "11.025 kHz, 16 bit, mono"; break;

case WAVE_F0RMAT_1S16. pszText = "22.05 kHz, 16 bit, stereo"; break;

case WAVE_FORMAT_2M08: pszText = "22.05 kHz, 8 bit, mono"; break;

case WAVE_FORMAT_2S08: pszText = "22.05 kHz, 8 bit, stereo"; break;

case WAVE_FORMAT_2M16: pszText = "22.05 kHz, 16 bit, mono"; break;

case WAVEJFORMATJ2S16. pszText = "22.05 kHz, 16 bit, stereo"; break;

case WAVEJ?ORMAT_4M08: pszText = "44.1 kHz, 8 bit, mono"; break;

case WAVE_FORMAT_4S08: pszText = "44.1 kHz, 8 bit, stereo"; break;

case WAVE_FORMAT_4M16: pszText = "44.1 kHz, 16 bit, mono"; break;

case WAVE_FORMAT_4S16:

pszText = "44.1 kHz, 16 bit, stereo";

break; default:

pszText = "Unknown";

break;} } break; default:

break;} if (IpszText) return;

: ^rawTextCpDI^hDC^szText.-L&CpDI^rcItem), DTLEFT | DTVCENTER); if (pDI->itemState & ODSSELECTED) {

::InvertRect(pDI->hDC, &(pDI->rcItem));} if (PDI->itemState & ODS_FOCUS) {

::DrawFocusRect(pDI->hDC, &(pDI->rdtem)); }}

void CRecordDlg::OnMeasureItem(int ruDCtl, LPMEASUREITEMSTRUCT lpMeasureltemStruct) { CClientDC dc (this);

TEXTMETRIC tm;

dc. GetTextMetrics(&tm);

lpMeasureItemStruct->itemHeight = tm.tmHeight;} void CRecordDlg::SetMode(MODE m) { CClientDC dc(this); if (m = miMode) return; if (m_pWave) m_pWave->Stop(); switch (miMode) {case SAMPLING: case RECORDING: mlnDev.ResetO; m_InDev.Close(); break; case PLAYING: break;

case OPEN:

break;}

miMode = IDLE;

switch (m) {case SAMPLING:

fcase RECORDING.

{int iSel = m_cbSource.GetCurSel(); if(iSel = CBERR) return;

WAVEINCAPS* pCaps = (WAVEINCAPS*) m_cbSource.GetItemData(iSeI);

ASSERT(pCaps);

UINT uiBD = pCaps->wMid;

iSel = m_cbFormat.GetCurSel();

if(iSel == CBERR) return;

DWORD dwFormat = mcbFormat.GetltemData(iSel);

ASSERT(dwFormat);

PCMWAVEFORMAT fmt;

BuildFormat(fmt, dwFormat);

if (!m_InDev.Open(uiID, &fmt)) return;

if (m = SAMPLING) {

mSampleWave.DeleteAllO;

mSampleWave. Create(&frnt);

m_SampleWave.Record(&m_InDev, 1024,&m_NotifyObj); } else if (m — RECORDING) { if (!m_pWave) m_pWave = new CWave; ASSERT(m_pWave); mjpWave->Create(&fmt);

m_pWave->Record(&mJnDev,4096,&m_NotifyObj);}

case PLAYING, if (m_pWave) m_pWave->Play(NULL, &m_NotifyObj); break;

case OPEN.

if (m_pWave) m_pWave->OpenData(NULL, &m_NotifyObj,&dc); break;} miMode = m,

if ((mjMode = PLAYING) || (mjMode = RECORDING)! |(m_iMode btnStop.EnableWindow(TRUE);

} else {m_btnStop.EnableWindow(FALSE);}

if (mjMode = PLAYING) { m_btnPlay.EnableWindow(FALSE); } else {mbtnPlay.EnableWindow(TRUE);}

if (m_iMode = OPEN) {mbtnOpenData.EnableWindow(FALSE); } else {mbtnOpenData.EnableWindow(TRUE);} if (mjMode = RECORDING) {m_btnRecord.EnableWindow(FALSE); } else {m_btnRecord.EnableWindow(TRUE);}} void CRecordDlg::NewData(CWave *pWave, CWaveBlock* pBlock) { ASSERT(pWave); ASSERT(pBlock);

PCMWAVEFORMAT* pwf = (PCMWAVEFORMAT*) pWave->GetFormat(); ASSERT(pwf->wf.wFormatTag = WAVEFORMATPCM); int iCount = pBlock->GefNumSamples(); if (pwf->wBitsPerSample = 8) {

BYTE* pData = (BYTE*)pBlock->GetSamplesO; BYTE bMax - 0; while (iCount—) {

if (*pData > bMax) bMax = *pData; pData++;}

if (bMax < 128) { bMax = 0;} else {bMax -= 128;} m_VU.SetValue(bMax « 8, bMax « 8); } else {ASSERT(sizeof(short int) = 2); short int* pData = (short int*) pBlock->GetSamples(); int iMax = 0;

while (iCount—) {if (*pData > iMax) iMax = *pData;

pData++;} m_VU.SetValue(iMax, iMax);} if(m_iMode!= RECORDING) { pWave->GetBlockList()->FreeAll();}} void CRecordDlg::EndPlayback(CWave *pWave) { ASSERT(pWave); SetMode(SAMPLjrNG);}

void CRecordDlg::BuildFormat(PCMWAVEFORMAT& fmt, DWORD dwFormat) { ASSERT(dwFormat); fmt.wf.wFormatTag = WAVEFORMATPCM; switch (dwFormat) { case WAVE_FORMAT_1M08: fmt.wf.nChannels = 1; rmtwf.nSamplesPerSec = 11025; fmtwBitsPerSample = 8; break;

case WAVE_F0RMAT_1M16: fmt.wf.nChannels = 1; fmt.wf.nSamplesPerSec = 11025; fmt.wBitsPerSample = 16; break;

case WAVE_FORMAT_1S08: fmt.wf.nChannels = 2; fmt.wf.nSamplesPerSec = 11025; fmt.wBitsPerSample = 8; break;

case WAVE_F0RMAT_1S16: fmt.wf.nChannels = 2; fmtwf.nSamplesPerSec = 11025; fmt.wBitsPerSample = 16; break;

case WAVE_FORMAT_2M08: fmt.wf.nChannels = 1; fmt.wf.nSamplesPerSec = 22050; fmt.wBitsPerSample = 8; break;

case WAVE FORMAT 2M16 fmt.wf.nChannels = 1; fmt.wf.nSamplesPerSec = 22050; fmt.wBitsPerSample = 16; break;

case WAVE_FORMAT_2S08: fmt.wf.nChannels = 2; fmt.wf.nSamplesPerSec = 22050; fmt.wBitsPerSample = 8; break;

case WAVE_FORMAT_2S16: fmt.wfnChannels = 2; fmt.wf.nSamplesPerSec = 22050;

fmt.wBitsPerSatnple = 16; break;

case WAVE_FORMAT_4M08: fmt.wf.nChannels = 1; fmt.wf. nSamplesPerSec = 44100; fmt.wBitsPerSampIe = 8; break;

case WAVE_FORMAT_4M16: fmt.wf.nChannels = 1; fmt.wf.nSamplesPerSec = 44100; fmt.wBitsPerSampIe = 16; break;

case WAVE_FORMAT_4S08. fmt.wf.nChannels = 2; fmt.wf.nSamplesPerSec = 44100; fmt.wBitsPerSampIe = 8; break;

case WAVE_FORMAT_4S 16:

fmt.wf.nChannels = 2;

fmt.wf.nSamplesPerSec = 44100;

fmtwBitsPerSample = 16;

break; default:

ASSERT(O);

return;}

fmt.wf.nAvgBytesPerSec = fmt.wf.nSamplesPerSec;

fmt.wf.nBlockAlign = fmt.wBitsPerSampIe /8;} CRecDlgNotifyObj::CRecDlgNotifyObj() { m_pDlg = NULL;} CRecDlgNotifyObj.:~CRecDlgNotifyObj() {}

void CRecDlgNotifyObj::NewData(CWave *pWave,CWaveBlock* pBlock) { ASSERT(m_pDlg);

m_pDlg->NewData(pWave, pBlock);} void CRecDlgNotifyObj::EndPlayback(CWave *pWave) { ASSERT(m_pDlg);

m_pDlg->EndPlayback(pWave);}

void CRecordDlg.:OnClickedOpenData0

{ SetMode(OPEN);

CClientDC dc(this);} CFilterDlg::CFilterDlg(CWnd* pParent /*=NULL*/): CDialog(CFilterDlg::IDD, pParent)

void CFilterDlg::DoDataExchange(CDataExchange* pDX)

{ CDialog::DoDataExchange(pDX);}

BEGIN_MESSAGE_MAP(CFilterDlg, CDialog)

ONJBN_CLICKED(IDC_FILTER, OnFilter) ENDMES S AGEM AP() void CFiIterDlg::OnFilterO (CCIientDC dc(this);

dc.SelectObject(GetStockObject(WHITE_PEN));

for(inti=0; i<110;i++)

{ dc.MoveTo(lO*i,0);

dc.LineTo(10*i,800);

dc.MoveTo(0,10*i);

dc.LineTo(1100,10*i);} dc.SelectObject(GetStockObject(BLACK_PEN)); dc.MoveTo(0,200); dc.LineTo(l 100,200); m_pOutDev->ShowFilter(&dc);}

void CRecordDlg::OnUpdate{) { CCIientDC dc(this); Update(&dc);}

void CRecordDlg::Update(CClientDC *curDC) (CWnd *win= curDC->GetWindowO; win->Invalidate(TRUE);}

int hspos=0; int curpos=0;

void CRecordDlg::OnHScroll(UTNT nSBCode, UINT nPos, CScrollBar* pScrollBar) { curpos=hspos;

switch (nSBCode) { case SBJLEFT:.