I want use function tfrsp of my sound from microphone
Show older comments
Hello. I have problem with function tfrsp. I want to use that function for spectrogram of sound. I can get the spectrogram of regular signal. This is the only thing what I can get from help tfrsp
tfrsp Spectrogram time-frequency distribution.
[TFR,T,F]=tfrsp(X,T,N,H,TRACE) computes the Spectrogram
distribution of a discrete-time signal X.
X : signal.
T : time instant(s) (default : 1:length(X)).
N : number of frequency bins (default : length(X)).
H : analysis window, H being normalized so as to
be of unit energy. (default : Hamming(N/4)).
TRACE : if nonzero, the progression of the algorithm is shown
(default : 0).
TFR : time-frequency representation. When called without
output arguments, tfrsp runs TFRQVIEW.
F : vector of normalized frequencies.
Example :
sig=fmlin(128,0.1,0.4);
h=tftb_window(17,'Kaiser'); tfrsp(sig,1:128,64,h,1);
[tfr,t,freq]=tfrsp(sig,1:128,64,h,1); plot(fftshift(freq),fftshift(tfr(:,100)))
When I try to use some sound what I took from my microphone example:
sig=audiorecorder;
record(sig);
stop(sig);
play(sig);
h=tftb_window(17,'rect');
[tfr,t,f]=tfrsp(sig,1:128,64,h,1);
Spectrogram
Undefined function 'times' for input arguments of type 'audiorecorder'.
Error in tfrsp (line 87)
tfr(indices,icol)=x(ti+tau).*conj(h(Lh+1+tau))/norm(h(Lh+1+tau));
>>or if I change time [tfr,t,f]=tfrsp(sig,1:length(sig),64,h,1);
Spectrogram
100 % complete in 0 seconds.
Undefined function 'times' for input arguments of type 'audiorecorder'.
Error in tfrsp (line 87)
tfr(indices,icol)=x(ti+tau).*conj(h(Lh+1+tau))/norm(h(Lh+1+tau));
thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!