BST的S变换的批处理研究(Matlab代码实现

本文介绍了一种名为BST的S变换批处理实现,旨在提高计算效率。BST支持MATLAB中的GPU和CPU加速,相比于原始S变换,加速比例分别达到12倍和5倍。它还可用于深度学习模型,结合在线增强策略提升性能,并具备水平挤压功能进行降维。实验展示了其在多个项目中的有效性和影响力。
摘要由CSDN通过智能技术生成

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

提出了一种名为BST的S变换的批处理实现,以提高频繁计算S变换的算法的效率。所提出的BST支持基于MATLAB的GPU加速和CPU矢量化加速,与原版S变换相比,分别可以实现约12倍和5倍的加速度。此外,所设计的BST还可以嵌入到深度神经网络中,并结合在线增强策略来增强模型性能。此外,BST支持水平挤压操作,可实现降维。BST已经在我们之前的多个作品中使用,显示了它的有效性和影响。

📚2 运行结果

 部分代码如下:

 

%% Main
clear;
ThisToolRootPath = pwd;
addpath(genpath(ThisToolRootPath));

%% Settings
rng('default')
s = rng;

nChannels = 10000;
randSignals = rand(1,256, nChannels);
Fs = 256;

sqzSize = 8;                    % Squeeze size (pooling size) along time axis
outputMode = 'psd';             % Output method ('amplitude', 'psd', 'phase', 'amplitude+phase', 'psd+phase')
selFreqRange = [1,50];          % Frequency range (Hz)
freqPrecision = 1;              % Frequency domain resolution
gaussianFactor = 0.5;           % p-value of generalized S-transform to ajust the Gaussian window shape

for iRepeat = 1:10
    %% Vanilla ST
    tic_vst = tic;
    stMap_vanilla_single = zeros(50, 32, nChannels);
    for i = 1:size(randSignals,3)
        curSignal = randSignals(:,:,i);
        stMap_vanilla_single(:,:,i) = FeatureExtract_STransSingle(curSignal,Fs,selFreqRange,freqPrecision,gaussianFactor,sqzSize, outputMode);
    
    end
    t_vst(iRepeat) = toc(tic_vst);
    disp(['Vanilla ST consumes: ' num2str(t_vst(iRepeat)) 's']);
    
    %% Mex ST
    tic_mst = tic;
    stMap_mex_single = zeros(50, 32, nChannels);
    for i = 1:size(randSignals,3)
        curSignal = randSignals(:,:,i);
        stMap_mex_single(:,:,i) = FeatureExtract_STransSingleMex(curSignal,Fs,selFreqRange,freqPrecision,gaussianFactor,sqzSize, outputMode);
    
    end
    t_mst(iRepeat) = toc(tic_mst);
    disp(['Mex ST consumes: ' num2str(t_mst(iRepeat)) 's']);
    
    %% Vectorized ST
    tic_gst = tic;
    stMap_Vec = FeatureExtract_STransGPU(randSignals,Fs,selFreqRange,freqPrecision,gaussianFactor,sqzSize, outputMode);
    t_vecst(iRepeat) = toc(tic_gst);
    disp(['Vectorized ST consumes: ' num2str(t_vecst(iRepeat)) 's']);
    
    %% GPU ST
    if canUseGPU
        randSignals_gpu = gpuArray(randSignals);
        tic_gst = tic;
        stMap_GPU = FeatureExtract_STransGPU(randSignals_gpu,Fs,selFreqRange,freqPrecision,gaussianFactor,sqzSize, outputMode);
        t_gst(iRepeat) = toc(tic_gst);
        stMap_GPU = gather(stMap_GPU);
        disp(['GPU ST consumes: ' num2str(t_gst(iRepeat)) 's']);
    end
    
    %% Validation
    error_GPU_V = sum(abs(stMap_Vec-stMap_vanilla_single), 'all');
    error_GPU_M = sum(abs(stMap_Vec-stMap_mex_single), 'all');
    error_V_M = sum(abs(stMap_vanilla_single-stMap_mex_single), 'all');

end

t_vst_mean = mean(t_vst);
t_vst_std = std(t_vst);
t_mst_mean = mean(t_mst);
t_mst_std = std(t_mst);
t_vecst_mean = mean(t_vecst);
t_vecst_std = std(t_vecst);
t_gst_mean = mean(t_gst);
t_gst_std = std(t_gst);
 

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]Guoyang Liu (2023) BST: A tool for batch processing of S-transform

[2]王鹏飞,任丽佳,高燕.基于不完全S变换和改进SVM的电能质量分类方法[J].制造业自动化,2023,45(01):115-119.

🌈4 Matlab代码实现

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值