I am using MATLAB R2013.
fs=8000;
t=(1:512)'/fs; %'//
f=306.396;
original=sin(2*pi*f*t)+0.2*randn(length(t),1);
windowed=original.*hamming(length(t));
[mag1,phase1,freq1]=fftOneSide(original,fs);
Error:
Undefined function 'fftOneSide' for input arguments of type 'double'
解决方案
This question was raised in a previous SO question, with apparently no response until now:
error in using fftoneside
Using your input for the signal, without using the hamming function (I don't have the signal toolbox on my computer), after defining the function below (I commented out the demo code at the bottom part and the first line with if nargin <1 obv!!), I ran it on Matlab2015a. It ran fine! Setting plotOpt=1 (that is calling with three arguments, the final e