If you have already booked your place in a school and in your student flat in Barcelona, you must know what legal steps you need to perform before beginning the course.
If you are a student will take courses, participate in exchanges of students, research activities, do unremunerated, or perform volunteer services and come from a country which is not a member of the European Union, you must obtain the visa corresponding to the initial authorization to stay in Spain. If you come from a member country of the European Union or a State party to the Agreement on the European Economic Area or the Swiss Confederation, and going to live in Barcelona for more than three months period you must obligatorily apply for registration in the Central Register Foreign where you will be given a certificate of registration and Foreigner Identification Number (NIE).
You must personally go to a police station the following documentation:
2 copies of the registration form (EX18).
Valid passport or identity card of your country: original plus photocopy
Original and copy of the registration of studies or admission letter
Health insurance
Affidavit that you have sufficient financial resources during your stay in Barcelona
In this link to the Ministry of Foreign Affairs and Cooperation you can find all the extended information in case you have any doubt.
However, at the secretary or at the welcome point of your school, they are going to inform you and deliver you all the necessary documents and will report the police station nearest to your student flat in Barcelona.