Multi-channel Matlab Audio
You are not logged in.
Hi,
first of all, I'd like to thank you for sharing your work with all of us. This is extremely interesting and stimulating.
I read PlayRec documentation, forum and even your 4th Year Project Report for the degree of MEng in Electronic Engineering but I still have some doubts about how to use and fully exploit PlayRec's functionalities.
My idea was to code up a new example file that made some common tasks in digital signal processing (let's say, for educational purposes):
- Take a mono (stereo) input
- Window it
- STFT
- Filtering (e.g low pass)
- Output filtered data.
While I know the theory behind all that stuff, I have some problems trying to apply them using page concept (probably I did not fully understand page concept itself...).
Question 1: windowing data requires overlap for good recontruction. How can I achieve that? If I take a L = 512 samples page, window it with a Hamming 512 samples window on output I have to overlap and add the first half with the prevoius page and the second half with the following one... and this happens of course even if I do not make any FFT or filtering. The only solution is to buffer output before sending it to the audio device?
Question 2: I may like to FFT windowed data using fft(data, N) where N >> L. Of course, after processing and IFFTing, data to be outputted will be N samples long and again, it needs overlapping. How do I manage the different input/output page? Is that the case PalyRec automatically sets the page size as the biggest (in this case, the output)?
I saw in the spectrum_analyzer example this parte (line: 108):
%very basic processing - windowing would produce a better output
recSampleBuffer = [recSampleBuffer(length(lastRecording) + 1:end,
; lastRecording];
recFFT = fft(recSampleBuffer)';
i.e. you do not FFTs only the "current" input (lastRecording) but also the prevoius one simply enqueing it. You would achieve similar results only FFTing the current input zero padding until the desired FFT lenght (which in this case was constrained to 2 * pageSize) Of course in the latter example you would loose resolution. The solution actually adopted in the example has advantages from a visual point of view, but if you need (as would be the case in the filtering example) to output modified data, how do you achieve that?
Thanks for support.
Adhara
Offline