声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1165|回复: 0

[其他] matlab z反变换后,如何进行cov运算,报错提示'sym'

[复制链接]
发表于 2014-7-17 17:33 | 显示全部楼层 |阅读模式

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

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

x
本人在进行信号的盲解卷积,以卷积混合的方式来仿真几个信号在传播过程中的混合现象,采用z变换来进行卷积,但是在z反变换后,接下来要进行cov求协方差,因z反变换后结果中有71*kroneckerDelta(n - 1, 0),所以报错,显示Undefined function 'bsxfun' for input arguments of type 'sym'.
Error in cov (line 93)
  xc = bsxfun(@minus,x,sum(x,1)/m);  % Remove mean
Error in pcamat (line 92)
covarianceMatrix = cov(vectors', 1);  应该是sym的问题,请问如何解决?  望各位给点建议。代码如下
clear all;close all;clc;
syms z;
n=0:1:99;
L=length(n);
win=L/50;
f1=0.01;f2=0.08;f3=0.1;f4=0.5;
s1=sin(2*pi*f1*n);
s2=sin(2*pi*0.5*f2*n);
s3=sin(2*pi*f3*n);
s4=sin(2*pi*f4*n);
figure('numbertitle','off','name','源信号')
subplot(221);plot(s1);
subplot(222);plot(s2);
subplot(223);plot(s3);
subplot(224);plot(s4);
Z=[z^0;z^(-1);z^(-2);z^(-3)];
a11=rand(1,4)*Z;a12=rand(1,4)*Z;a13=rand(1,4)*Z;a14=rand(1,4)*Z;
a21=rand(1,4)*Z;a22=rand(1,4)*Z;a23=rand(1,4)*Z;a24=rand(1,4)*Z;
a31=rand(1,4)*Z;a32=rand(1,4)*Z;a33=rand(1,4)*Z;a34=rand(1,4)*Z;
a41=rand(1,4)*Z;a42=rand(1,4)*Z;a43=rand(1,4)*Z;a44=rand(1,4)*Z;
A=[a11 a12 a13 a14;a21 a22 a23 a24;a31 a32 a33 a34;a41 a42 a43 a44];
s=[s1;s2;s3;s4];
x=A*s;
x=simple(x);
X=iztrans(x);
m1=X(1,:);m2=X(2,:);m3=X(3,:);m4=X(4,:);%%%%%%%%%%白化
m1=m1-mean(m1); %白化开始
m2=m2-mean(m2);
m3=m3-mean(m3);
m4=m4-mean(m4);
xin=[m1;m2;m3;m4];
Rxx=(xin*xin')/size(xin,2); %%%%%%%%%%%求协方差矩阵
[E,D]=pcamat(xin);
[vec,wm,dwm]=whitenv(xin,E,D);
回复
分享到:

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-6 18:39 , Processed in 0.053273 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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