The invention relates to a silencer comprising an inlet pipe, an outlet pipe, a hollow expansion cavity formed between the inlet pipe and the outlet pipe, and a perforated acoustic metamateiral bafflearranged vertically or obliquely at the internal cross section of the hollow expansion cavity. The a perforated acoustic metamateiral baffle includes a frame; a constraint body in rigid connection with the frame is arranged inside the frame; a thin film covers the surface of the frame; and through holes are formed in the constraint body and the thin film. In addition, the invention also relates to an improved silencer; and occurrence of standing wave damping valley of the traditional resistant silencer is avoided and the good low-frequency noise elimination effect is realized. In addition, according to another embodiment, the invention also relates to an improved silencer, so that a problem of the direct contact between the sound absorption material and the fluid is solved. And accordingto another embodiment, the invention also relates to a silencer for improving the heat transfer efficiency of the fluid medium at the two sides of the hole by using vibration of a perforated acousticmetamateiral baffle. Besides, the invention also provides a method for frequency modulation and preparation of a perforated acoustic metamateiral baffle and a method of assembling the silencer. The silencer has characteristics of compact structure, simple process, stable performance, and long service life.