Matlab时频工具箱中tfrsp函数的说明和使用方法

官方说明

TFRSP为Spectrogram time-frequency distribution,即时频分布谱图。

函数原型为 [TFR,T,F]=TFRSP(X,T,N,H,TRACE) ,用于计算离散时间信号X的谱图分布。

X     : 信号
T     : 时间序列(s) (默认 : 1:length(X))。
N     : 频率数 (默认 : length(X))。指的是频率分辨率
H     : 分析窗,H是正规化的以便成为单位能量 (默认 : Hamming(N/4))。
TRACE :如果非零,则显示算法的进展 (默认 : 0)。
TFR   : 时频表达式。当没有输出参数时,TFRSP运行TFRQVIEW,用自带的图形显示窗口显示。
F     : 正规化的频率矢量。

具体使用

生成待分析的信号

首先我们用fmlin这个函数生成一个长度为128,正规化频率由0.1逐渐变为0.4的线性调频信号:

sig=fmlin(128,0.1,0.4);

用plot(real(sig))可以看到其波形:

sig其实是复数,其模始终为1:

下面我们将用这个信号进行时频分析。

设置窗函数

由于tfrsp函数的输入参数H为窗函数,所以我们需要选择一个合适的窗函数。为什么在时频分析时要选择窗函数,并且选择什么样的窗函数、窗的尺寸是多少,请参考相关文章。如:https://www.vfe.cc/NewsDetail-2239.aspx

这里我们选择Kaiser窗函数,并设置长度为17,参数默认(3*pi)。

h=tftb_window(17,'Kaiser');

设置参数

我们按照官方说明的要求,逐一设置参数,信号为sig,时间点为1至128,频率数为64,窗函数为h,显示算法进展:

tfrsp(sig,1:128,64,h,1);

由于没有输出参数,所以直接运行调用了TFRQVIEW,结果如下:

可以看到命令行窗口显示了算法进度,并自动产生了TFRQVIEW显示窗口,谱图显示频率从0.1变化为0.4。

输出参数

我们使用imagesc(tfr)来观察第一个输出的参数。结果如下:

由于我们的频率数设置为64,所以纵坐标轴的值除以64才是正规化后的频率,即0.1至0.4。

 

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
很实用的时频分析工具箱,包括短时傅里叶正反变换等,很好,很强大哦~~分享给大家,包括以下函数的源代码: % sigmerge - Add two signals with given energy ratio in dB. % % Choice of the Instantaneous Amplitude % amexpo1s - Generate one-sided exponential amplitude modulation. % amexpo2s - Generate bilateral exponential amplitude modulation. % amgauss - Generate gaussian amplitude modulation. % amrect - Generate rectangular amplitude modulation. % amtriang - Generate triangular amplitude modulation. % % Choice of the Instantaneous Frequency % fmconst - Signal with constant frequency modulation. % fmhyp - Signal with hyperbolic frequency modulation. % fmlin - Signal with linear frequency modulation. % fmodany - Signal with arbitrary frequency modulation. % fmpar - Signal with parabolic frequency modulation. % fmpower - Signal with power-law frequency modulation. % fmsin - Signal with sinusoidal frequency modulation. % gdpower - Signal with a power-law group delay. % % Choice of Particular Signals % altes - Altes signal in time domain. % anaask - Amplitude Shift Keyed (ASK) signal. % anabpsk - Binary Phase Shift Keyed (BPSK) signal. % anafsk - Frequency Shift Keyed (FSK) signal. % anapulse - Analytic projection of unit amplitude impulse signal. % anaqpsk - Quaternary Phase Shift Keyed (QPSK) signal. % anasing - Lipschitz singularity. % anastep - Analytic projection of unit step signal. % atoms - Linear combination of elementary Gaussian wave packets. % dopnoise - Generate complex Doppler random signal. % doppler - Generate complex Doppler signal. % klauder - Klauder wavelet in time domain. % mexhat - Mexican hat wavelet in time domain. % tftb_window - Window generation (previously window.m). % % Addition of Noise % noisecg - Analytic complex gaussian noise. % noisecu - Analytic complex uniform noise. % % Modification % scale - Scale signal using Mellin transform. % % % Processing Files % % Time-Domain Processing % ifestar2 - Instantaneous frequency estimation using AR2 modelisation. % instfreq - Instantaneous frequency estimation. % loctime - Time localization characteristics. % % Frequency-Domain Processing % fmt - Fast Mellin transform % ifmt - Inverse fast Mellin transform. % locfreq - Frequency localization characteristics. % sgrpdlay - Group delay estimation. % % Linear Time-Frequency Processing % tfrgabor - Gabor representation. % tfrstft - Short time Fourier transform. % % Bilinear Time-Frequency Processing in the Cohen's Class % tfrbj - Born-Jordan distribution. % tfrbud - Butterworth distribution. % tfrcw - Choi-Williams distribution. % tfrgrd - Generalized rectangular distribution. % tfrmh - Margenau-Hill distribution. % tfrmhs - Margenau-Hill-Spectrogram distribution. % tfrmmce - MMCE combination of spectrograms. % tfrpage - Page distribution. % tfrpmh - Pseudo Margenau-Hill distribution. % tfrppage - Pseudo Page distribution. % tfrpwv - Pseudo Wigner-Ville distribution. % tfrri - Rihaczek distribution. % tfrridb - Reduced interference distribution (Bessel window). % tfrridh - Reduced interference distribution (Hanning window). % tfrridn - Reduced interference distribution (binomial window). % tfrridt - Reduced interference distribution (triangular window). % tfrsp - Spectrogram. % tfrspwv - Smoothed Pseudo Wigner-Ville distribution. % tfrwv - Wigner-Ville distribution. % tfrzam - Zhao-Atlas-Marks distribution. % % Bilinear Time-Frequency Processing in the Affine Class % tfrbert - Unitary Bertrand distribution. % tfrdfla - D-Flandrin distribution. % tfrscalo - Scalogram, for Morlet or Mexican hat wavelet. % tfrspaw - Smoothed Pseudo Affine Wigner distributions. % tfrunter - Unterberger distribution, active or passive form. % % Reassigned Time-Frequency Processing % tfrrgab - Reassigned Gabor spectrogram. % tfrrmsc - Reassigned Morlet Scalogram time-frequency distribution. % tfrrpmh - Reassigned Pseudo Margenau-Hill distribution. % tfrrppag - Reassigned Pseudo Page distribution. % tfrrpwv - Reassigned Pseudo Wigner-Ville distribution. % tfrrsp - Reassigned Spectrogram. % tfrrspwv - Reassigned Smoothed Pseudo WV distribution. % % Ambiguity Functions % ambifunb - Narrow band ambiguity function. % ambifuwb - Wide band ambiguity function. % % Post-Processing or Help to the Interpretation % friedman - Instantaneous frequency density. % holder - Estimate the Holder exponent through an affine TFR. % htl - Hough transform for detection of lines in images. % margtfr - Marginals and energy of a time-frequency representation. % midscomp - Mid-point construction used in the interference diagram. % momftfr - Frequency moments of a time-frequency representation. % momttfr - Time moments of a time-frequency representation. % plotsid - Schematic interference diagram of FM signals. % renyi - Measure Renyi information. % ridges - Extraction of ridges. % tfrideal - Ideal TFR for given frequency laws. % % Visualization & backup % plotifl - Plot normalized instantaneous frequency laws. % tfrqview - Quick visualization of time-frequency representations. % tfrview - Visualization of time-frequency representations. % tfrparam - Return the paramaters needed to display (or save) a TFR. % tfrsave - Save the parameters of a time-frequency representation. % % % Other % disprog - Display progression of a loop. % divider - Find dividers of integer such that product equals integer. % dwindow - Derive a window. % integ - Approximate integral. % integ2d - Approximate 2-D integral. % izak - Inverse Zak transform. % istfr1 - returns true if a distribution is Cohen's class type 1 (spectrogram) % istfr2 - returns true if a distribution is Cohen's class type 2 (Wigner-Ville) % istfraff - returns true is a distribution is an affine class member % kaytth - Kay-Tretter filter computation. % modulo - Congruence of a vector. % movcw4at - Four atoms rotating, analyzed by the Choi-Williams distribution. % movpwdph - Influence of a phase-shift on the interferences of the pWVD. % movpwjph - Influence of a jump of phase on the interferences of the pWVD. % movsc2wv - Movie illustrating the passage from the scalogram to the WVD. % movsp2wv - Movie illustrating the passage from the spectrogram to the WVD. % movwv2at - Oscillating structure of the interferences of the WVD. % odd - Round towards nearest odd value. % sigmerge - Add two signals with given energy ratio in dB. % zak - Zak transform. % griffitc - Test signal example C of Griffiths' paper. % lambdak - Evaluate lambda function for Affine Wigner distribution. % umaxbert - Determination of the maximum value of u for Bertrand distribution. % umaxdfla - Determination of the maximum value of u for D-Flandrin distribution. % umaxunte - Determination of the maximum value of u for Unterberger distribution.
时频分析工具箱提供了计算各种线性时频表示和双线性时频分布的函数, 本帖主要列出时频分析工具箱函数简介,以号召大家就时频分析应用展开相关讨论。 一、信号产生函数: amexpo1s 单边指数幅值调制信号 amexpo2s 双边指数幅值调制信号 amgauss 高斯幅值调制信号 amrect 矩形幅值调制信号 amtriang 三角形幅值调制信号 fmconst 定频调制信号 fmhyp 双曲线频率调制信号 fmlin 线性频率调制信号 fmodany 任意频率调制信号 fmpar 抛物线频率调制信号 fmpower 幂指数频率调制信号 fmsin 正弦频率调制信号 gdpower 能量律群延迟信号 altes 时域Altes信号 anaask 幅值键移信号 anabpsk 二进制相位键移信号 anafsk 频率键移信号 anapulse 单位脉冲信号的解析投影 anaqpsk 四进制相位键移信号 anasing Lipscjitz 奇异性 anaste 单位阶跃信号的解析投影 atoms 基本高斯元的线性组合 dopnoise 复多普勒任意信号 doppler 复多普勒信号 klauder 时域Klauder小波 mexhat 时域墨西哥帽小波 二、噪声产生函数 noiseecg 解析复高斯噪声 noiseecu 解析复单位高斯噪声 tfrgabor Gabor表示 tfrstft 短时傅立叶变换 ifestar2 使用AR(2)模型的瞬时频率估计 instfreq 瞬时频率估计 sqrpdlay 群延迟估计 三、模糊函数 ambifunb 窄带模糊函数 ambifuwb 宽带模糊函数 四、Affine类双核线性时频处理函数 tfrbert 单式Bertrand分布 tfrdfla D-Flandrin分布 tfrscalo 尺度图 tfrspaw 平滑伪Affine类Wigner分布 tfrunter Unterberger分布 五、Cohen类双核线性时频处理函数 tfrbj Born-Jordan分布 tfrbud Butterworth分布 tfrcw Choi-Williams分布 tfrgrd 归一化的矩形分布 tfrmh Margenau-Hill分布 tfrmhs Margenau-Hill频谱分布 tfrmmce 谱图的最小平均互熵组合 tfrpage Page分布 tfrwv 伪Wigner-Ville分布 tfrri Rihaczek分布 tfrridb 降低交叉项的分布(Bessel窗) tfrridbn 降低交叉项的分布(二项式窗) tfrridh 降低交叉项的分布(汉宁窗) tfrridt 降低交叉项的分布(三角窗) tfrsp 谱图分布 tfrspwv 平滑伪Wigner-Ville分布 tfrwv Wigner-Ville分布 tfrzam Zhao-Atlas-Marks分布 六、其他处理函数: friedman 瞬时频率密度 htl 图像直线检测的Hough变换 margtfr 时频表示的能量 momftfr 时频表示的频率矩 momttfr 时频表示的时间矩 renyi Renyi信息度量 ridges 波峰提取 plotifl 绘制归一化的瞬时频率规律 tfrparam 返回用于显示时频表示的参数 tfrqview 时频表示的快速可视化 tfrsave 保存时频表示的参数 tfrview 时频表示的可视化

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值