Can't use gpuArray with melSpectrogram

1 回表示 (過去 30 日間)
Ivan Lisman
Ivan Lisman 2021 年 5 月 6 日
回答済み: Edric Ellis 2021 年 5 月 7 日
Hi!
I'm using Matlab R2019a and i'm trying to make some mel spectrograms for a dataset. As I have to use many songs and my PC isn't the best, I thought about using my gpu in order to enhance the performance (I have a GeForce 940MX).
It goes something like this:
[audioIn,fs] = audioread(song_path);
audioIn = gpuArray(audioIn); % gpu
figure('visible', 'off')
melSpectrogram(audioIn,fs)
colorbar('off')
colormap(gray)
set(gca,'visible','off')
export_fig(final_melspect_path, '-png', '-transparent', '-r75');
But I ran into the following:
Error using cast
Unsupported data type for conversion:
'gpuArray'.
Error in melSpectrogram (line 75)
range=hz2mel(cast(params.FrequencyRange,class(x)));
Error in dataset_generator (line 28)
melSpectrogram(audioIn,fs)
I went to cast() and melSpectrogram() MATLAB pages and both says that they SUPPORT GPU ARRAYS.
It may have something to do with my version? Maybe something about the code?
Thank you in advance!

採用された回答

Edric Ellis
Edric Ellis 2021 年 5 月 7 日
gpuArray support for melSpectrogram was added in R2020a. See the release notes.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFeature Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by