摘要:在当今社会中,电力的使用愈加广泛,不同环境中不同设备对电力信号的要求也各不相同,这时,常常需要对电力信号进行频谱分析以确定其是否符合各项要求。
本系统通过对系统自产生的正弦波采样,对采样所得结果进行快速傅立叶算法分析,测得输入信号的频率、相位及频谱信息,分析测得的信息,研究得出最适合的采样频率(当输入信号频率一定时),以达到校准系统的目的。本系统通过信号变换模块对外接电力信号进行电压变换,使其符合C8051F020的采样要求,通过按键模块设置采样频率,C8051F020对输入信号进行采样、快速傅立叶变换算法分析,在LCD1602上显示分析得出的频率、相位,并将测得的频谱信息通讯到上位机上,以待进一步研究。
本系统可以检测输入信号的频率、相位及频谱信息。
关键词:电力信号;C8051F020;快速傅立叶变换;LCD1602;通讯
Abstract:Nowadays,electric power is widely used.Under different environments,different devices have different requirements for power signal.At this moment,it is necessary for the power signal to analyze the frequency spectrum so that the power signal can be determined whether it complies with all the requirements.
This system takes samples of the sine wave signal which is sent from C8051F020 and analyses the sampling results through FFT,then there will be frequency, phase and spectrum analysis of the input signal.Analysing the measured information,the most suitable sampling frequency can be gotten out(the frequency of input signal is constant),so that the system can be calibrated.This system transforms the voltage of external power signal into the appropriate value for C8051F020.Through the key module,sampling frequency can be set.C8051F020 takes samples of the input signal,and analyses the sampling results through FFT.Frequency and phase can be displayed on the LCD1602.Spectrum information measured by C8051F020 can be communicated to the PC,so that it can be used in the further research.
This system can measure the frequency,phase and spectrum information of the input signal.
Key word:power signal;C8051F020;FFT;LCD1602;communication
本系统可以设置DAC0输出正弦波频率和ADC0采样频率,对DAC0输出正弦波频率进行采样、快速傅立叶变换算法分析与实现,实现对系统的校准;可以对外接电力信号进行采样,计算出其频率、相位及频谱信息。
本系统系统中,DAC0查表数据只有64个,采样点数128点,采样DAC0输出正弦波时,采样所得结果与理想值并不完全相同,可以通过增加DAC0查表数据和采样点数来减小误差。
在以后的设计中,可以优化系统程序,使系统测算更准确,也可以将实时监测功能加入系统中,减小系统使用难度,增大其适用范围。