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);
Unrecognized function or variable 'psdg'.
Getting unrecognized function for psdg. Not sure why as this is a built in fucntion.

2 Kommentare

Is the function called psd or really psdg
There is no Mathworks function by that name.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

John D'Errico
John D'Errico am 12 Okt. 2022
Bearbeitet: John D'Errico am 12 Okt. 2022
which psdg -all
'psdg' not found.
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.

Produkte

Version

R2021a

Gefragt:

am 12 Okt. 2022

Bearbeitet:

am 12 Okt. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by