Zero padding issue - cut the buffer I have some issue with zero padding. It's probably because I don't understand it enough. 

I have buffer size set to 400. And I use radix-2 fft. So I take the input signal 400 samples, and add to them 112 zeros. So I have acceptable 512 buffer size for radix-2. And then I take the output of fft (freq spectrum) and send it to inverse radix fft. And that's what I get:


it's my buffer window of size 512. So the end of buffer is cut. I suppose it's those 112 zeros. So it looks quite  logical: actually I sent to my forward fft buffer size that has signal only for first 400 samples, and the rest are zeros. So after inverse I get what I had on input. I can understand that. But how to deal with that?

OK, I think I could just use from inverse fft output just those first 400 samples and it probably would work. But I wonder if it's proper way? Maybe there is some smarter solution, some filtering or what?
The result you experience is reasonable. The IDFT performs exactly the inverse operation of the forward DFT. Hence, for every signal $x[n], n=0...L$ you have the identity:

$$x[n] = \text{IDFT}\{\text{DFT}\{x[n]\}\}$$

This property is valid for DFT and hence also for FFT (as it is a special implementation of DFT). 

So, if you insert a zero-padded sequence $x[n]$ into the FFT and immediately perform IFFT you obtain the zeropadded sequence as the output.

The question is: Why would you want to do that? If you think of performing filtering in the frequency domain, dont do it.