The black ghost knifefish is considered to possess central pattern generators (CPGs), which generates rhythms in neural circuits, coordinating the deformation of its elongated fin to achieve efficient and agile locomotion. Current biomimetic robots imitating the locomotion of the black ghost knifefish and using an undulating propulsion control method face significant challenges in adapting their swimming gaits to different environments and tasks. To overcome this limitation, this study conducted biomimetic robot research that extended from morphology to neurobiology and mimicked the CPG to construct a unified framework based on coupled Hopf oscillators. Meanwhile, an amplitude mapping function and a novel coupling method for the CPG-based control framework are proposed. The advantages of the proposed control framework are the ability to modulate different control parameters and replicate different swimming gaits, including forward, hovering, and backward swimming, realising seamless gait transitions. The control framework was tested on a specially designed undulating fin platform to evaluate the propulsion performance by modulating the control parameters, including amplitude, frequency, and phase difference. The experimental results demonstrate that the proposed CPG-based control framework achieves multimodal locomotion, enabling rapid and smooth transitions between swimming gaits, thus enhancing the robot's adaptability and stability in variable swimming environments.