声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1800|回复: 0

[编程技巧] 求助:请问matcom里面如何编译pwelch函数(功率谱的welch方法)

[复制链接]
发表于 2008-8-14 23:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
使用的是matcom for bcb
我的M文件如下:
clear;
Fs=1000;
n=0:1/Fs:1;
xn=cos(2*pi*40*n)+3*cos(2*pi*100*n)+randn(size(n));
nfft=1024;
window=boxcar(100); %矩形窗
window1=hamming(100); %海明窗
window2=blackman(100); %blackman窗
noverlap=20; %数据无重叠
range='onesided'; %频率间隔为[0 Fs/2],只计算一半的频率
[Pxx,f]=pwelch(xn,window,noverlap,nfft,Fs,range);
[Pxx1,f]=pwelch(xn,window1,noverlap,nfft,Fs,range);
[Pxx2,f]=pwelch(xn,window2,noverlap,nfft,Fs,range);
plot_Pxx=10*log10(Pxx);
plot_Pxx1=10*log10(Pxx1);
plot_Pxx2=10*log10(Pxx2);

figure(1)
plot(f,plot_Pxx);

figure(2)
plot(f,plot_Pxx1);

figure(3)
plot(f,plot_Pxx2);

编译时出错:
Using Borland C++ (or Builder) : Target WinNT/Win95 (Win32)
------------------------------------------------------------
jit70131 : Translating jit70131.m
buffer: Using MEX file
Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
pwelch.cpp:
Loaded pre-compiled headers.
Error E2268 c:/matcom45/welchcpp/pwelch.m 89: Call to undefined function 'nargoutchk' in function pwelch(Mm,Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2227 c:/matcom45/welchcpp/pwelch.m 101: Extra parameter in call to welch() in function pwelch(Mm,Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &)
*** 2 errors in Compile ***
psdoptions.cpp:
Loaded pre-compiled headers.
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 52: Could not find a match for 'istrue()' in function psdoptions(Mm,Mm,Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 59: Could not find a match for 'istrue()' in function psdoptions(Mm,Mm,Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 67: Could not find a match for 'istrue()' in function psdoptions(Mm,Mm,Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 81: Could not find a match for 'istrue()' in function psdoptions(Mm,Mm,Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 89: Could not find a match for 'istrue()' in function psdoptions(Mm,Mm,Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 274: Could not find a match for 'istrue()' in function psd_parse(Mm,i_o_t,Mm &,Mm &)
Error E2280 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 295: Member identifier expected in function psd_parse(Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 303: Could not find a match for 'istrue()' in function psd_parse(Mm,i_o_t,Mm &,Mm &)
Error E2280 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 308: Member identifier expected in function psd_parse(Mm,i_o_t,Mm &,Mm &)
Error E2285
f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 364: Could not find a match for 'istrue()' in function RemoveSpecialChar(Mm)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/psdoptions.m 367: Could not find a match for 'istrue()' in function RemoveSpecialChar(Mm)
*** 11 errors in Compile ***
buffer.cpp:
Loaded pre-compiled headers.
Error E2451 f:/program files/matlab71/toolbox/signal/signal/buffer.m 108: Undefined symbol 'varargout' in function buffer(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &)
*** 1 errors in Compile ***
mex.cpp:
Loaded pre-compiled headers.
Error E2268 f:/program files/matlab71/toolbox/matlab/general/mex.m 203: Call to undefined function 'inmem' in function mex(Mm)
Error E2206 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Illegal character '\' (0x5c) in function read_response_file(Mm)
Error E2206 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Illegal character '\' (0x5c) in function read_response_file(Mm)
Error E2277 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Lvalue required in function read_response_file(Mm)
Error E2121 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Function call missing ) in function read_response_file(Mm)
Error E2379 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Statement missing ; in function read_response_file(Mm)
Error E2206 f:/program files/matlab71/toolbox/matlab/general/mex.m 292:
Illegal character '\' (0x5c) in function read_response_file(Mm)
Error E2206 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Illegal character '\' (0x5c) in function read_response_file(Mm)
Error E2380 f:/program files/matlab71/toolbox/matlab/general/mex.m 292: Unterminated string or character constant in function read_response_file(Mm)
Error E2087 f:/program files/matlab71/toolbox/matlab/general/mex.m 298: Illegal use of pointer in function read_response_file(Mm)
Error E2268 f:/program files/matlab71/toolbox/matlab/general/mex.m 428: Call to undefined function 'inmem' in function clear_mex_file(Mm)
Error E2285 f:/program files/matlab71/toolbox/matlab/general/mex.m 444: Could not find a match for 'error(Mm,Mm,Mm)' in function make_rsp_file(Mm,Mm,i_o_t,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/matlab/general/mex.m 450: Could not find a match for 'error(Mm,Mm,Mm)' in function make_rsp_file(Mm,Mm,i_o_t,Mm &,Mm &)
*** 13 errors in Compile ***
fileparts.cpp:
Loaded pre-compiled headers.
Error E2285 f:/program files/matlab71/toolbox/matlab/iofun/fileparts.m 45: Could not find a match for 'istrue()' in function fileparts(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/matlab/iofun/fileparts.m 45: Could not find a match for 'istrue()' in function fileparts(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/matlab/iofun/fileparts.m 53: Could not find a match for 'istrue()'
in function fileparts(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &)
*** 3 errors in Compile ***
spectrum.cpp:
Loaded pre-compiled headers.
Error E2188 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 231: Expression syntax in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2377 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 241: If statement missing ) in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 335: Could not find a match for 'istrue()' in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2268 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 339: Call to undefined function 'numel' in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 339: Could not find a match for 'istrue()' in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 339: Could not find a match for 'istrue()' in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2285 f:/program files/matlab71/toolbox/signal/signal/spectrum.m 346: Could not find a match for 'istrue()' in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
Error E2285
f:/program files/matlab71/toolbox/signal/signal/spectrum.m 349: Could not find a match for 'istrue()' in function specchk(Mm,i_o_t,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &,Mm &)
*** 8 errors in Compile ***
detrend.cpp:
Loaded pre-compiled headers.
Error E2285 f:/program files/matlab71/toolbox/matlab/datafun/detrend.m 50: Could not find a match for 'warning(Mm,Mm,Mm)' in function detrend(Mm,Mm,Mm)
*** 1 errors in Compile ***
g_jit70131.cpp:
Loaded pre-compiled headers.
Compilation failed.

请高手指点
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-14 01:58 , Processed in 0.058256 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表