Applied Speech and Audio Processing: With matlab examples
Download 2.66 Mb. Pdf ko'rish
|
Applied Speech and Audio Processing With MATLAB Examples ( PDFDrive )
Basic audio processing
Now, in general, this may only be required when the processing performed on neigh- bouring analysis frames is different. If, for example, the same digital filter acts on two neighbouring analysis frames, then is there any reason why there should be any dis- continuity between them? Well it turns out that yes, there may well be a discontinuity unless we carefully consider the way we perform the filtering. Let us illustrate this effect in Matlab with some speech which we can filter and replay. First, record a few seconds of speech at an 8 kHz sample rate as described in Section 2.1. We shall assume this is in an array named s. As we know this could be replayed and listened to very simply: soundsc(s); Next we will define a small digital filter to act upon the speech. For the purpose of testing, we can define a simple transfer function h = (1 − 0.9375z −1 ), which is actually one we will encounter later in Chapter 5, used for the pre-emphasis of speech. In the following Matlab code, we will create the filter, apply to the entire array of speech, then listen to the result, in vector y: h=[1, -0.9375]; y=filter(h, 1, s); soundsc(y); We should hear a sound that is ‘tinny’ or ‘nasal’ but is otherwise clear speech. Now we will repeat the filtering, but this time will split the speech recording into a succession of 240 sample frames, each of which will be filtered individually, and then reassembled: w=240; n=floor(length(s)/w); for k=1:n seg=s(1+(k-1)*w:k*w); segf=filter(h, 1, seg); outsp(1+(k-1)*w:k*w)=segf; end soundsc(outsp); The output should still sound similar, but will most likely be marred by a succession of audible clicks. Interestingly, if we were to plot the filtered output signals y and outsp , they would probably appear indistinguishable. It is only using methods like the spectrogram (see Section 2.6) that these clicks or discontinuities would become visible. So now two questions remain: firstly, what causes the discontinuities, and secondly how can we prevent them from happening? The cause may be immediately obvious if one considers exactly what the filtering process is doing. In effect, an FIR filter is describing a process where ‘the current output sample is a sum of the current input sample plus the previous P input samples, each scaled by some coefficients’, where P is |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling