Create olsd

olsd function from serena ng matlab code