Why do I get unrecognized function for a built in function?
显示 更早的评论
%%
% AM Signal Generation Routine
%
clear
close all
%%
% Select a test waveform
load train;
% Listen to the test waveform
p1 = audioplayer(y, Fs);
playblocking(p1);
[nrow,ncol]=size(y);
if ncol ==2
y=sum(y,2);
end
%%
% Set Signal Rates and Constants
Interprate=8;
Fmax=Fs/2;
Fis=Interprate*Fs;
Fc=Fis/4;
mu=0.5;
FFTsize=4096;
FreqAxis=((1:FFTsize)'-1)*Fis/FFTsize;
FreqAxis2=((1:FFTsize)'-1)*Fis/FFTsize - Fis/2;
%Determine the time sample instances
maxtime=length(y)/Fs;
timevect=(0:1/Fis:(maxtime-1/Fis))';
tvlength=length(timevect);
%%
% Increase the sampled data rate prior to modulation
% Built in MATLAB function to increase sample rate
[message,InterpFilter] = interp(y,Interprate);
SpecInterpFilter=fft(InterpFilter/sum(InterpFilter),FFTsize);
BeqnIntF=0.5*(sum(psdg(SpecInterpFilter))/psdg(SpecInterpFilter(1)))*(Fis/FFTsize);
Getting unrecognized function for psdg. Not sure why as this is a built in fucntion.
2 个评论
chrisw23
2022-10-12
Is the function called psd or really psdg
Walter Roberson
2022-10-12
There is no Mathworks function by that name.
回答(1 个)
which psdg -all
As you can see, psdg does not exist as a MATLAB function, in any toolbox we can search, and they are all pretty much accessible from here.
Most likely, psdg is a function that you got from somebody else, or one you should look to from someone else. Here, for example, we see a call with that name, but no code provided.
But it is not a built-in MATLAB function that I can find. A possibility is this is a typo, that you misspelled the name.
类别
在 帮助中心 和 File Exchange 中查找有关 Pulsed Waveforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!