Got error in resample function
Mostra commenti meno recenti
I am a beginner of Matlab and I was trying to resample y by this resample function
but i got an error: " Incorrect number or types of inputs or outputs for function resample. "
please tell me what is the problem if you know. thanks a lot.
load handel.mat
y = y(:);
Fs = 8192;
fc = 2e5;
Fs_new = ceil( (Fs/2 + fc) / Fs * 2 ) * Fs;
y_resampled = resample(y,Fs_new,Fs);
5 Commenti
It works here:
load handel.mat
y = y(:);
Fs = 8192;
fc = 2e5;
Fs_new = ceil( (Fs/2 + fc) / Fs * 2 ) * Fs;
y_resampled = resample(y,Fs_new,Fs)
I am guessing that you are calling another RESAMPLE function. Please show us the complete output when you call WHICH:
which resample -all
Yijin
il 9 Apr 2025
Stephen23
il 9 Apr 2025
Do you have the Signal Processing Toolbox installed and a valid license for it?
Image Analyst
il 9 Apr 2025
Set a breakpoint at that line and step into resample to further investigate.
Yijin
il 9 Apr 2025
Risposte (1)
load handel.mat
y = y(:)
Fs = 8192;
fc = 2e5;
t = linspace(0, numel(y)-1, numel(y)).'/Fs; % Create Time Vector
Fs_new = ceil( (Fs/2 + fc) / Fs * 2 ) * Fs
% y_resampled = resample(y,Fs_new,Fs);
ytt = timetable(seconds(t), y) % Original ‘timetable’
yttrs = retime(ytt, 'regular', 'linear', SampleRate=Fs_new) % Resulting ‘timetable’ After Using ‘retime’
These are part of core MATLAB, so you should have them.
.
Categorie
Scopri di più su Multirate Signal Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!