You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: CFO_Classen.m
    path of file: ./repos/MIMO-OFDM-Wireless-Communications-with-MATLAB
    
    the code of the file until where you have to start completion: function CFO_est=CFO_Classen(yp,Nfft,Ng,Nps)
% Frequency-domain CFO estimation using Classen method based on pilot tones
% 利用Classen方法，基于导频的频域CFO估计技术
% Nps : Pilot spacing|导频间隔，或者就是导频本身，取决于调用时给的参数


    
function CFO_est=CFO_Classen(yp,Nfft,Ng,Nps)
% Frequency-domain CFO estimation using Classen method based on pilot tones
% 利用Classen方法，基于导频的频域CFO估计技术
% Nps : Pilot spacing|导频间隔，或者就是导频本身，取决于调用时给的参数


% MIMO-OFDM Wireless Communications with MATLAB㈢   Yong Soo Cho, Jaekwon Kim, Won Young Yang and Chung G. Kang
% 2010 John Wiley & Sons (Asia) Pte Ltd

% http://www.wiley.com//legacy/wileychi/cho/

if length(Nps)==1, % 调用时给的可能是导频间隔，也可能是导频本身，需要判断
    Xp=add_pilot(zeros(1,Nfft),Nfft,Nps); % Pilot signal|导频信号
else
    Xp=Nps; % If Nps is given as an array, it must be a pilot sequence Xp
end