Inclusion Criteria:  (1)Signed informed consent by patient or legal representative; (2) male or female patient aged ≧20 and ≦70 years; (3) a diagnosis of MDD or BD according to DSM criteria made by a specialist in psychiatry; (4) a total score of at least 18 in the Hamilton Rating Scale for Depression (HDRS) at the screening stage; (5) patient or a reliable caregiver can be expected to ensure acceptable compliance and visit attendance for the duration of the study.  Exclusion Criteria:  (1) women of childbearing potential, not using adequate contraception as per investigator judgment or not willing to comply with contraception for the duration of the study; (2) females who are pregnant or breast-feeding; (3) other major DSM 5 diagnoses other than mood disorders, except for tobacco use disorder and anxiety disorder; (4) current evidence of an uncontrolled and/or clinically significant medical condition, e.g. patients with extensive area of ischemic bruise, multiple sclerosis, cardiac, hepatic and renal failure that would compromise patient safety or preclude study participation; (5) history of seizure or epilepsy; (6) history of neurological diseases or traumatic brain injury; (7) history of brain lesion, having received neurosurgery, meningitis or encephalitis; (8) exacerbation of symptom severity, presenting severe suicidal ideation or self harm behavior during the screen or study period; (9) presence of devices, e.g. pacemakers, cochlear prosthesis, neuro-stimulators, magnetic cochlear prosthesis, intracranial/intraocular metallic fragments; (10) patient has received electroconvulsive therapy (ECT) within 3 months prior to the first intervention of the treatment; (11) skin lesion at local site receiving rTMS stimulation; (12) those who cannot tolerate the side effects or ever developed sleep disorder while receiving rTMS therapy.