基于短时傅里叶变换的变转速滚动轴承故障特征提取方法研究,这是个什么程序呀

clear, clc, close all

% load an audio file

[x, fs] = audioread('track.wav'); % load an audio file

x = x(:, 1); % get the first channel

% define analysis parameters

% wlen = 1024; % window length (recomended to be power of 2)

hop = wlen/4; % hop size (recomended to be power of 2)

nfft = 4096; % number of fft points (recomended to be power of 2)

% perform STFT

win = blackman(wlen, 'periodic');

[S, f, t] = stft(x, win, hop, nfft, fs);

% calculate the coherent amplification of the window

C = sum(win)/wlen;

% take the amplitude of fft(x) and scale it, so not to be a

% function of the length of the window and its coherent amplification

S = abs(S)/wlen/C;

% correction of the DC & Nyquist component

if rem(nfft, 2) % odd nfft excludes Nyquist point

S(2:end, :) = S(2:end, :).*2;

else % even nfft includes Nyquist point

S(2:end-1, :) = S(2:end-1, :).*2;

end

% convert amplitude spectrum to dB (min = -120 dB)

S = 20*log10(S + 1e-6);

% plot the spectrogram

figure(1)

surf(t, f, S)

shading interp

axis tight

view(0, 90)

set(gca, 'FontName', 'Times New Roman', 'FontSize', 14)

xlabel('Time, s')

ylabel('Frequency, Hz')

title('Amplitude spectrogram of the signal')

hcol = colorbar;

set(hcol, 'FontName', 'Times New Roman', 'FontSize', 14)

ylabel(hcol, 'Magnitude, dB')

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值