Undefined function 'fftxx' for input arguments of type 'double'.

4 views (last 30 days)
Undefined function 'fftxx' for input arguments of type 'double'.
Error in komtar1 (line 636) [fyy,nfyy,dfrq,velof,dispf]=fftxx(RR1,dt,np);
may i know wat is it mean and how to solve it? Thanks.

Accepted Answer

John BG
John BG on 27 Feb 2016
in R2015a there is no fftxx command, just fft
try fft instead of fftx
If you find this answer of any help solving this question, please click on the thumbs-up vote link, thanks in advance
John
  2 Comments
Andrew Wawa
Andrew Wawa on 28 Feb 2016
Edited: Andrew Wawa on 28 Feb 2016
currently i am using 2014a, if i am using fft instead of fftxx, the error occured as
Error using fft Too many output arguments.
Error in komtar1 (line 636) [fyy,nfyy,dfrq,velof,dispf]=fft(yy,dt,np);|__
John BG
John BG on 28 Feb 2016
Wawa
May be you would like to have a look at the DTFT
x=signal_of_interest
n=[1:1:length(L1)] % generate time reference for x
x=double(x)
k=0:500;w=(pi/500)*k % generate frequency reference
X=x*(exp(-j*pi/500)).^(n'*k)
X=x*(exp(-j*pi/500)).^(n'*k)
magX=abs(X);angX=angle(X);realX=real(X);imagX=imag(X)
figure(15);subplot(2,2,1);plot(k/500,magX);grid
xlabel('freq[rad]');title('Magnitude(X)')
figure(15);subplot(2,2,3);plot(k/500,angX/pi);grid
xlabel('freq[rad]');title('Phase(X)')
figure(15);subplot(2,2,2);plot(k/500,realX);grid
xlabel('freq[rad]');title('Real(X)')
figure(15);subplot(2,2,4);plot(k/500,imagX);grid
xlabel('freq[pi]');title('Imag(X)')
From
send me your email and I will send you back the pages you may like to read.
Also very important, the class DSP
1.- generate a simple tone:
hsin1 = dsp.SineWave(2, 10) hsin1.SamplesPerFrame = 1000 y = step(hsin1) plot(y)
swei tone
hsin2 = dsp.SineWave
hsin2.Frequency = 10
hsin2.PhaseOffset = [0 pi/2]
y = step(hsin2)
plot(y)
any signal shape
hsr1 = dsp.SignalSource;
hsr1.Signal = randn(1024, 1);
y1 = zeros(1024,1);
idx = 1;
while(~isDone(hsr1))
y1(idx) = step(hsr1);
idx = idx+1;
end
2.- Use Time Scopes
hsin = dsp.SineWave('Frequency',100, 'SampleRate', 1000)
hsin.SamplesPerFrame = 10
hts1 = dsp.TimeScope('SampleRate', hsin.SampleRate,'TimeSpan', 0.1)
for ii = 1:10
x = step(hsin)
step(hts1, x)
end
release(hts1)
another Time Scope
Fs = 1000; % Sampling frequency
hsin1 = dsp.SineWave('Frequency',50,...
'SampleRate',Fs, ...
'SamplesPerFrame', 100);
% Create FIRDecimator System object to decimate by 2
hfilt = dsp.FIRDecimator;
% Create TimeScope System object with 2 input ports (channels)
hts2 = dsp.TimeScope(2, [Fs Fs/2], ...
'TimeDisplayOffset', [0 38/Fs], ...
'TimeSpan', 0.25, ...
'YLimits',[-1 1], ...
'ShowLegend', true);
for ii = 1:2
xsine = step(hsin1);
xdec = step(hfilt,xsine);
step(hts2, xsine, xdec);
end
phasors time display
fs = 1000; t = (0:1/fs:10)'
CxSine = cos(2*pi*0.2*t) + 1i*sin(2*pi*0.2*t)
CxSineSum = cumsum(CxSine)
figure(101); subplot(2,1,1); stairs(t,abs(CxSineSum)) % Plot magnitude
subplot(2,1,2); stairs(t,(180/pi)*angle(CxSineSum)) % Plot phase in deg
h1 = dsp.TimeScope(1, fs, 'TimeSpanSource', 'Auto')
step(h1,CxSineSum)
set(h1,'PlotAsMagnitudePhase',true)
release(h1)
% close(101)
% clear h1 fs t CxSine CxSineSum
3.- Spectrum Analyzer, 2 tones
hsin = dsp.SineWave('Frequency',100,'SampleRate',1000) hsin.SamplesPerFrame = 1000 hsa = dsp.SpectrumAnalyzer('SampleRate',hsin.SampleRate) for ii = 1:250 x = step(hsin) + 0.05*randn(1000,1) step(hsa, x) end release(hsa) % clear('hsa')
five tones
Fs = 100e6; % Sampling frequency
fSz = 5000; % Frame size
hsin1 = dsp.SineWave(1e0, 5e6, 0, 'SamplesPerFrame', fSz, 'SampleRate', Fs)
hsin2 = dsp.SineWave(1e-1, 15e6, 0, 'SamplesPerFrame', fSz, 'SampleRate', Fs)
hsin3 = dsp.SineWave(1e-2, 25e6, 0, 'SamplesPerFrame', fSz, 'SampleRate', Fs)
hsin4 = dsp.SineWave(1e-3, 35e6, 0, 'SamplesPerFrame', fSz, 'SampleRate', Fs)
hsin5 = dsp.SineWave(1e-4, 45e6, 0, 'SamplesPerFrame', fSz, 'SampleRate', Fs)
hsb = dsp.SpectrumAnalyzer
hsb.SampleRate = Fs
hsb.SpectralAverages = 1
hsb.PlotAsTwoSidedSpectrum = false
hsb.RBWSource = 'Auto'
hsb.PowerUnits = 'dBW'
hsb.Position = [749 227 976 721]
for idx = 1:1e2
y1 = step(hsin1)
y2 = step(hsin2)
y3 = step(hsin3)
y4 = step(hsin4)
y5 = step(hsin5)
step(hsb,y1+y2+y3+y4+y5+0.0001*randn(fSz,1))
end
release(hsb)
release('hsb')
chirp
Fs = 233e3
frameSize = 20e3
hchirp = dsp.Chirp('SampleRate',Fs,...
'SamplesPerFrame',frameSize,...
'InitialFrequency',11e3,...
'TargetFrequency',11e3+55e3)
hss = dsp.SpectrumAnalyzer('SampleRate',Fs)
hss.SpectrumType = 'Spectrogram'
hss.RBWSource = 'Property'
hss.RBW = 500
hss.TimeSpanSource = 'Property'
hss.TimeSpan = 2
hss.PlotAsTwoSidedSpectrum = false
for idx = 1:50
y = step(hchirp)+ 0.05*randn(frameSize,1)
step(hss,y)
end
release(hss)
hope it helps
John

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!