Robert Kerr, 39, inflicted 76 wounds on 39-year-old Xin Xin Liu at their home in Newton Mearns, East Renfrewshire.
He admitted culpable homicide on the grounds of diminished responsibility at an earlier hearing.
Judge Lord Boyd ordered he be detained in the high security psychiatric unit at Carstairs, Lanarkshire.
The ruling was made following a hearing at the High Court in Edinburgh.
Kerr attacked his wife on 26 April 2016 as their two sons slept upstairs.
Just before midnight, he dialled 999 and admitted: "I have just killed my wife. I murdered her in a stabbing frenzy."
Police discovered Xin Xin lying on the kitchen floor with a knife still in her body.
The judge ruled that Kerr should be sent to Carstairs after hearing from Dr Natasha Bilcliff, a consultant forensic psychiatrist at the hospital.
She said that Kerr suffered from a "delusional disorder" and could only be treated at Carstairs.
Lord Boyd agreed and told Kerr that public safety required him to be sent there.
Lord Boyd said: "I am satisfied that medical treatment is available that would be likely to alleviate the symptoms or effects of the disorder and that if medical treatment was not provided there would be a significant risk to your health, safety or welfare and to the safety of other persons.
"I am also satisfied that this treatment can only be provided if you are detained in hospital. Such detention requires you to be under conditions of special security and that can only be provided in the State Hospital.
"Accordingly, I shall make a compulsion order under section 57A of the Criminal Procedure Scotland Act 1995 ordering that you be detained in the State Hospital together with a restriction order under section 59 of the act providing that the detention be without limit of time."
A lecturer who killed his wife after wrongly believing he was not the father of their children is to be detained in the State Hospital indefinitely.