前言

之前讲了MTM(多锥形窗谱估计)的相关原理,现在来分析一下它的matlab实现。
想要复习的可以参考一下之前的文件:
现代谱估计:多窗口谱
想要复习一下如何实现的可以参考:
MTM:matlab实现1MTM:matlab实现1
MTM:matlab实现2参数解析MTM参数解析
MTM:matlab实现3谱功率计算MTM谱功率计算

目录

  • 前言
  • 目录
  • 主函数调用说明

主函数调用说明

function varargout = pmtm(x,varargin)
%PMTM   Power Spectral Density (PSD) estimate via the Thomson multitaper
%   method (MTM).
%   Pxx = PMTM(X) returns the Power Spectral Density (PSD) estimate, Pxx,
%   of a discrete-time signal X. When X is a vector, it is converted to a
%   column vector and treated as a single channel.  When X is a matrix, the
%   PSD is computed independently for each column and stored in the
%   corresponding column of Pxx. Pxx is the distribution of power per unit
%   frequency. The frequency is expressed in units of radians/sample.
%
%   For real signals, PMTM returns the one-sided PSD by default; for
%   complex signals, it returns the two-sided PSD.  Note that a one-sided
%   PSD contains the total power of the input signal.
%
%   Pxx = PMTM(X,NW) specifies NW as the "time-bandwidth product" for the
%   discrete prolate spheroidal sequences (or Slepian sequences) used as
%   data windows.  Typical choices for NW are 2, 5/2, 3, 7/2, or 4. If
%   empty or omitted, NW defaults to 4. By default, PMTM drops the last
%   taper because its corresponding eigenvalue is significantly smaller
%   than 1. Therefore, The number of tapers used to form Pxx is 2*NW-1.
%
%   Pxx = PMTM(X,NW,NFFT) specifies the FFT length used to calculate the
%   PSD estimates.  For real X, Pxx has (NFFT/2+1) rows if NFFT is even,
%   and (NFFT+1)/2 rows if NFFT is odd.  For complex X, Pxx always has
%   length NFFT.  If NFFT is specified as empty, NFFT is set to either
%   256 or the next power of 2 greater than the length of X, whichever is
%   larger.
%
%   [Pxx,W] = PMTM(X,NW,NFFT) returns the vector of normalized angular
%   frequencies, W, at which the PSD is estimated.  W has units of
%   radians/sample.  For real signals, W spans the interval [0,Pi] when
%   NFFT is even and [0,Pi) when NFFT is odd.  For complex signals, W
%   always spans the interval [0,2*Pi).
%
%   [Pxx,W] = PMTM(X,NW,W) computes the two-sided PSD at the normalized
%   angular frequencies contained in vector W. W must have at least two
%   elements.
%常规调用,输入为 x,nw,NFFT,fs
%   [Pxx,F] = PMTM(X,NW,NFFT,Fs) returns a PSD computed as a function of
%   physical frequency.  Fs is the sampling frequency specified in hertz.
%   If Fs is empty, it defaults to 1 Hz.
%
%   F is the vector of frequencies (in hertz) at which the PSD is
%   estimated.  For real signals, F spans the interval [0,Fs/2] when NFFT
%   is even and [0,Fs/2) when NFFT is odd.  For complex signals, F always
%   spans the interval [0,Fs).
%
%   [Pxx,F] = PMTM(X,NW,F,Fs) computes the two-sided PSD at the frequencies
%   contained in vector F.  F is a vector of frequencies in Hz with 2 or
%   more elements.
%
%   [Pxx,F] = PMTM(...,Fs,method) uses the algorithm specified in method
%   for combining the individual spectral estimates:
%      'adapt'  - Thomson's adaptive non-linear combination (default).
%      'unity'  - linear combination with unity weights.
%      'eigen'  - linear combination with eigenvalue weights.
%
%   [Pxx,F] = PMTM(X,E,V,NFFT,Fs,method) is the PSD estimate, and frequency
%   vector from the data tapers in E and their concentrations V.  Type HELP
%   DPSS for a description of the matrix E and the vector V. By default,
%   PMTM drops the last eigenvector because its corresponding eigenvalue is
%   significantly smaller than 1.
%
%   [Pxx,F] = PMTM(X,DPSS_PARAMS,NFFT,Fs,method) uses the cell
%   array DPSS_PARAMS containing the input arguments to DPSS (listed in
%   order, but excluding the first argument) to compute the data tapers.
%   For example, PMTM(x,{3.5,'trace'},512,1000) calculates the prolate
%   spheroidal sequences for NW=3.5, NFFT=512, and Fs=1000, and displays
%   the method that DPSS uses for this calculation. Type HELP DPSS for
%   other options.
%
%   [Pxx,F] = PMTM(...,'DropLastTaper',DROPFLAG) specifies whether PMTM
%   should drop the last taper/eigenvector during the calculation. DROPFLAG
%   can be one of the following values: [ {true} | false ].
%       true  - the last taper/eigenvector is dropped
%       false - the last taper/eigenvector is preserved
%
%   [Pxx,F,Pxxc] = PMTM(...,'ConfidenceLevel',P) returns the P*100%
%   confidence interval for Pxx, where P is a scalar between 0 and 1. The
%   default value for P is .95.  Confidence intervals are computed using a
%   chi-squared approach. Pxxc has twice as many columns as Pxx.
%   Odd-numbered columns contain the lower bounds of the confidence
%   intervals; even-numbered columns contain the upper bounds.  Thus,
%   Pxxc(M,2*N-1) is the lower bound and Pxxc(M,2*N) is the upper bound
%   corresponding to the estimate Pxx(M,N).
%
%   [...] = PMTM(X,...,FREQRANGE) returns the PSD over the specified range
%   of frequencies based upon the value of FREQRANGE:
%
%      'onesided' - returns the one-sided PSD of a real input signal X.
%         If NFFT is even, Pxx has length NFFT/2+1 and is computed over the
%         interval [0,pi].  If NFFT is odd, Pxx has length (NFFT+1)/2 and
%         is computed over the interval [0,pi). When Fs is specified, the
%         intervals become [0,Fs/2) and [0,Fs/2] for even and odd NFFT,
%         respectively.
%
%      'twosided' - returns the two-sided PSD for either real or complex
%         input X.  Pxx has length NFFT and is computed over the interval
%         [0,2*pi). When Fs is specified, the interval becomes [0,Fs).
%
%      'centered' - returns the centered two-sided PSD for either real or
%         complex X.  Pxx has length NFFT and is computed over the interval
%         (-pi, pi] for even length NFFT and (-pi, pi) for odd length NFFT.
%         When Fs is specified, the intervals become (-Fs/2, Fs/2] and
%         (-Fs/2, Fs/2) for even and odd length NFFT, respectively.
%
%      FREQRANGE may be placed in any position in the input argument list
%      after the second input argument, unless E and V are specified, in
%      which case FREQRANGE may be placed in any position after the third
%      input argument.  The default value of FREQRANGE is 'onesided' when X
%      is real and 'twosided' when X is complex.
%
%   PMTM(...) with no output arguments plots the PSD estimate (in decibels
%   per unit frequency) in the current figure window.
%
%   EXAMPLE:
%      Fs = 1000;   t = 0:1/Fs:.3;
%      x = cos(2*pi*t*200)+randn(size(t)); % A cosine of 200Hz plus noise
%      pmtm(x,3.5,[],Fs);                  % Uses the default NFFT.
%
%   See also DPSS, PWELCH, PERIODOGRAM, PMUSIC, PBURG, PYULEAR, PCOV,
%   PMCOV, PEIG.%   References:
%     [1] Thomson, D.J."Spectrum estimation and harmonic analysis."
%         In Proceedings of the IEEE. Vol. 10 (1982). pp. 1055-1096.
%     [2] Percival, D.B. and Walden, A.T., "Spectral Analysis For Phy
ical
%         Applications", Cambridge University Press, 1993, pp. 368-370. %   Copyright 1988-2014 The MathWorks, Inc.

MTM:matlab实现4主函数相关推荐

  1. MTM:matlab实现5主函数解码

    前言 之前讲了MTM(多锥形窗谱估计)的相关原理,现在来分析一下它的matlab实现. 想要复习的可以参考一下之前的文件: 现代谱估计:多窗口谱 想要复习一下如何实现的可以参考: MTM:matlab ...

  2. matlab怎么调用主函数,Matlab中一个函数调用另外一个函数的操作步骤

    原创Matlab中一个函数调用另外一个函数的操作步骤 编辑:小安 来源:PC下载网时间:2019-11-18 13:27:35 最近很多伙伴才刚刚安装入手Matlab这款软件,而本节就重点介绍了关于M ...

  3. matlab表示sa函数,SA:T1编写主函数法和T2Matlab自带的SA工具箱GUI法,两种方法实现对二元函数优化求解——Jason niu...

    %SA:T1法利用Matlab编写主函数实现对定义域[-5,5]上的二元函数求最优解-Jason niu [x,y] = meshgrid(-5:0.1:5,-5:0.1:5); z = x.^2 + ...

  4. matlab子函数相互调用吗,matlab主函数如何调用子函数

    来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2021/03/18 18:00:53 matlab主函数如何调用子函数 我编写了一个matlab子函数是关于龙格库塔计算的 主函数内容为: fo ...

  5. Matlab基础 主函数与子函数的调用关系

    % 主函数与子函数调用规则 % 主函数能够调用子函数,子函数能调用子函数,但子函数不能调用主函数 %例子function s=myfun % 文件名myfun.m num=input('输入一个正整数 ...

  6. matlab车牌识别毕设论文,MATLAB小白一个,毕设做一个基于MATLAB的车牌识别系统,出现索引超出矩阵维度的错误。主函数和自定义函数都写出来了(书上找的),希望大神帮助...

    [fn,pn,fi]=uigetfile('AD.jpg','选择图片'); I=imread([pn fn]); figure, imshow(I); title('原始图像'); Im1=rgb2 ...

  7. MATLAB机器学习系列-4函数篇

    Matlab中的函数及其调用 1.匿名函数 匿名函数格式 函数名=@(参数)(函数体): 如 myfundhd=@(x)(x+2); 我们可以在命令行窗口直接输入匿名函数,然后调用 或者在m文件点击执 ...

  8. leetcode c程序总提示主函数_Matlab系列之函数嵌套

    昨天的那一篇讲的几个函数,不知道你们理解的如何,是否懂得怎么去使用了,如果还没懂,一定要再多看几遍,并且去在软件上进行实操,今天的话,将要介绍一下函数的嵌套,不过在正式讲嵌套之前,先对主函数和子函数做 ...

  9. matlab 自带pca函数,matlab实现主成分分析 princomp函数 PCA中有这个函数

    matlab实现主成分分析 princomp函数 最近看了些主成分分析,混迹Matlab论坛,翻了n多帖子,对princomp函数有了些了解. 在此只讲一些个人理解,并没有用术语,只求通俗. 贡献率: ...

最新文章

  1. javascript读取XML文档
  2. AI模糊测试:下一个重大网络安全威胁
  3. 计算机开始按钮作用,Win8.1的12个变化:开始按钮回归功能不再
  4. C++ Opengl旋转源码
  5. Yii获取指定URL路径字符串
  6. java8 遍历目录_使用java8API遍历过滤文件目录及子目录及隐藏文件
  7. pdo mysql 存储过程 out_PHP_PDO 调用mysql 带返回参数的存储过程
  8. linux实例大全学习笔记1
  9. 《大数据原理:复杂信息的准备、共享和分析》一一2.5 在标识符中嵌入信息:不推荐...
  10. c++ 链表_剑指offer系列——52. 两个链表的第一个公共结点
  11. java 格式化字符串
  12. Codeforces Round #449 (Div. 2) B Chtholly's request (预处理)
  13. 【转】项目代码风格要求
  14. python输入一个三位数输出百位十位个位_“任意输入一个三位数,输出这个三位数的百位、十位和个位,并且计算十位百位个位的和。”c语言程序...
  15. 主曲率、平均曲率、高斯曲率、法曲率、主方向
  16. 服务器安全,服务器密码遭篡改
  17. 【ICPC】2019徐州 H Yuuki and a problem | 树套树、思维
  18. python 删除pdf页面_使用Python批量删除扫描PDF中的空白页
  19. MySQL数据库(二)高级
  20. 利用脑电和功能磁共振成像(fMRI)捕捉自我生成、任务启动的思维的时空动态

热门文章

  1. powerbi visualization
  2. medical research
  3. 明天mbzuai面试的准备,严阵以待
  4. UE4 C++与蓝图的继承问题
  5. ELK之filebeat、logstash多个topic配置
  6. Redis分布式锁---完美实现
  7. 内置传感器---智能手机(资料)
  8. Hadoop HA+Federation 高可用联邦模式搭建指南
  9. implicit assignment of unexported field
  10. Sublime3安装过程及常用插件安装及常用快捷键