资源简介
随机子空间法的python实现,用于振动信号模态识别
代码片段和文件信息
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy import linalg
class ran_subsid():
def __init__(selftdata):
self.tdata=tdata
def subsid(self):
print(self.tdata.shape)
(TimePointNum MesNodeTotalNum) = self.tdata.shape
MesNodeTotalNum = MesNodeTotalNum - 1
TimePointNum = TimePointNum
N = 2 * n
M = 100 # 将字符串转化为数值
j = TimePointNum - 2 * M # Hankel矩阵最后一个矩阵块对应坐标为(2 * i,j) 即2 * i + j需 <= TimePointNum
Hankel = np.zeros(((2 * M + 1) * MesNodeTotalNum j))
for col in range(0 j):
m = 0
for row in range(0 (2 * M + 1)):
km = col + row
m = m + 1
Hankel[row col] = self.tdata[km 1]
print(Hankel.shape)
Yp = Hankel[0:M * MesNodeTotalNum :]
Yf = Hankel[M * MesNodeTotalNum:2 * M * MesNodeTotalNum :]
Yf2 = Hankel[(M + 1) * MesNodeTotalNum:(2 * M + 1) * MesNodeTotalNum :]
# print(Yp.shape Yf.shape Yf2.shape)
Teop1 = np.dot(Yf np.transpose(Yp)) / j
# 组成第二个Toeplitz矩阵
Teop2 = np.dot(Yf2 np.transpose(Yp)) / j
# print(‘Teop1:‘ Teop1.shape)
# # 组成第一个Toeplitz矩阵
[U S V] = np.linalg.svd(Teop1)
S1 = np.diag(S)
# print(‘S1:‘S1.shape)
plt.plot(S ‘k*‘) # S1Y用黑色的星号表示
plt.ylabel(‘Singular value‘)
plt.xlabel(‘Order of system‘)
plt.title(‘Singular value decomposition results ‘)
plt.show()
# #
相关资源
- python实现SGBM图像匹配算法
- python实现灰度直方图均衡化
- scrapy_qunar_one
- Python学习全系列教程永久可用
- python简明教程.chm
- 抽奖大转盘python的图形化界面
- 双边滤波器实验报告及代码python
- python +MYSQL+HTML实现21蛋糕网上商城
- Python-直播答题助手自动检测出题搜索
- OpenCV入门教程+OpenCV官方教程中文版
- Python 串口工具源码+.exe文件
- Python开发的全栈股票系统.zip
- Python操作Excel表格并将其中部分数据写
- python书籍 PDF
- 利用python绘制散点图
- python+labview+No1.vi
- 老男孩python项目实战
- python源码制作whl文件.rar
- python3.5可用的scipy
- PYTHON3 经典50案例.pptx
- 计算机科学导论-python.pdf
- python模拟鼠标点击屏幕
- windows鼠标自动点击py脚本
- 鱼c小甲鱼零基础学python全套课后题和
- Python 练习题100道
- Practical Programming 2nd Edition
- wxPython Application Development Cookbook
- python 3.6
- Python 3.5.2 中文文档 互联网唯一CHM版本
- python3.5.2.chm官方文档
评论
共有 条评论