当前位置:网站首页>Digital signal processing experiment (I)

Digital signal processing experiment (I)

2022-07-23 18:18:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

The experiment purpose

The purpose of this experiment is : stay matlab Several basic digital signals are generated in the environment , And operate and transform these basic signals , At the same time, the sampling theorem is verified by the program results , Deep understanding of sampling theorem . Record audio signals by yourself and process different audio signals , Deepen your understanding of the principle of sound channel in audio signal , And mixing 、 The formation principle of echo .

Experimental content

  1. use matlab Generate unit pulse signal , Unit step signal , Rectangular signal , Sine signal , Cosine signal , Exponential signals , Produce and observe f(x)=sinc(x) The waveform of the function .
  2. utilize matlab Realize the algebraic operation of discrete-time signals , Shift operation , Folding operation , Convolution operation , Differential transformation and proportional transformation .
  3. Verification of sampling theorem Explore the impact of sampling on signal reconstruction , The influence of frequency truncation on signal reconstruction .
  4. Audio experiment

Analysis of experimental results

1. use matlab Generate unit pulse signal , Unit step signal , Rectangular signal , Sine signal , Cosine signal , Exponential signals , Produce and observe f(x)=sinc(x) The waveform of the function .

chart (a) It represents the unit pulse sequence , chart (b) It represents the unit step sequence , The unit pulse sequence is 0 The value at is 1, The values at other points are 0; The unit step sequence is greater than or equal to 0 The value at the point of is 1, The values at other points are 0.

chart (c) Represents a rectangular sequence , Rectangular sequence in 20-30 The value between is 1, The value of other points is 0; chart (d) Represents a sinusoidal sequence , Sine sequence has obvious periodicity .

chart (e) It represents a real exponential sequence , Its function prototype is f(x)=(5/4)x f(x)=(5/4)^x chart (f) Represents a complex exponential sequence , The four subgraphs represent the real part sequence of the complex exponential sequence 、 Imaginary part sequence 、 Modular sequence and phase angle sequence . Its function prototype is f(x)=(0.8eπi/4)x f(x)=(0.8e^{\pi i/4})^x.

chart (g) It means sinc function ,sinc The prototype of the function is f(x)=sin(x)/x f(x)=sin(x)/x, In mathematical analysis , Yes sin(x) stay 0 Let's get out of here , You can get sinc Function in 0 The value at is 1.

2. utilize matlab Realize the algebraic operation of discrete-time signals , Shift operation , Folding operation , Convolution operation , Differential transformation and proportional transformation .

chart (a) It represents the shift of unit pulse sequence , The left subgraph is the original sequence , Right subgraph is shifted to the right 5 A sequence of units . chart (b) It is the sequence after the unit step sequence is folded . From negative infinity to 0 The value of is 1, The values of other points are 0.

chart (c) Represents a sequence 1 And sequence 2 The effect picture after adding , Sequence 1 Is a sinusoidal sequence , The functional prototype of the sequence is f(x)=0.3sin(πx/6) f(x)=0.3sin(\pi x/6); Sequence 2 Is a cosine sequence , The functional prototype of the sequence is f(x)=0.2cos(πx/4) f(x)=0.2cos(\pi x/4) , chart (d) Representation sequence convolution .

3. Verification of sampling theorem

Explore the impact of sampling on signal reconstruction , The influence of frequency truncation on signal reconstruction . First, the signal is sampled at different frequencies , Critical sampling is the Nyquist critical value , Oversampling in the experiment , Under sampling and critical sampling are tested , The experimental results are shown below .

chart (a) Indicates under sampling , chart (b) Indicates critical sampling , The thick green line indicates the original signal , The black thin line represents the reconstructed signal after sampling , From the experimental results of undersampling and critical sampling, we observed : There is a certain difference between the under sampled reconstructed signal and the original signal , The reconstructed signal of critical sampling is approximately the same as the original signal .

chart (c) It indicates oversampling , chart (d) It represents the critical sampling situation , The thick green line indicates the original signal , The black thin line represents the reconstructed signal after sampling . It can be seen from the results of two sampling experiments : After two kinds of sampling, the reconstructed signal is similar to the original signal . Through this test , We have a deeper understanding of the sampling theorem . The sampling frequency must be greater than the highest frequency of twice the signal spectrum . Next, we will analyze the influence of frequency resolution on sampling . The experimental signal is f(t)=1(−1≤t≤1) f(t)=1(-1\leq t \leq 1) The experimental signal spectrum is F(w)=2sin(w)/w F(w)=2sin(w)/w

chart (a) It's the original signal , chart (b) Is the spectrum of the signal .

chart (c) Indicates sampling intercept ws = 1000 Time sampling signal sequence , chart (d) yes ws = 1000 The reconstructed signal of time , It can be seen that when ws Value of 1000 when , The sampling process can only approximate 0 Nearby signals .

chart (e) Sum graph (f) Yes, the cut-off frequency is Sampling sequence and reconstructed signal , It can be seen that it is better than ws = 1000 It is closer to the original signal .

4. Audio experiment

Audio acquisition : Use matlab function wavrecord() Record sound signals at both ends , Set the recording frequency FS=11025, And use wavplay() Function to play , Use wavwrite() The function stores the recorded audio file with the suffix wav The audio file for .

Audio signal processing : Digitize the acquired audio signal First, draw the time domain spectrum of the signals at both ends :

Sub figure above a music yes a.wav Time domain spectrum of the document , The following subgraph b music yes b.wav Time domain spectrum of the document . Next, we will synthesize the two sound signals , Generate mixed signal 、 And echo signals .

The generation of mixed sound is obtained by linearly changing the two sound signals , In this experiment y1 The coefficient of is 1,y2 The coefficient of is 0.3. Then normalize the generated new signal to form a graph 5.1 Mixed sound of . The principle of echo generation is to linearly change the sound signal in different time periods . First, echo information is generated , Then mix the echo information with the original information , You get the echo information .

summary

After this experiment , Learn how to use matlab Tools for basic signal processing . First, simulate the graphics of different basic sequences , Secondly, the Nyquist sampling theorem is experimentally explored , The Nyquist sampling theorem is further verified by experiments . At the same time, the influence of cut-off frequency on sampling is analyzed experimentally . Finally, practice operation and record audio information , And mix 、 Echo and other operations . Through this experiment of testing technology , I learned a lot of practical knowledge , More importantly, the process of doing experiments , Ways of thinking , This is common to other experiments , It really benefits us a lot .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/126598.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207231546139872.html