A man, who described himself as a "psycho", killed his neighbour with a sword two months after being discharged from a psychiatric hospital, the Old Bailey has heard.