File size adjustment using FFT
The algorithm sets the high frequency DFT coefficients to zero hence effectively providing a lowpass filtering on the time domain signal. Your problem was on the line of creating Y1, which I replaced with the corrected form. I've changed the code a little bit also. 

% part 1:
[y, f] = audioread('C:\path to your wav file');
y = y(1:1024*64);                % select a portion of it.

Ya = fftshift(fft(y));           % Compute DFT Ya[k] and SHIFT it
N = length(Ya);                  % Length of DFT Ya[k]

figure,plot(-f/2+f/N:f/N:f/2 , abs(Ya))  % plot the DFT magnitude.

% part 2:
Yr = zeros(1,N);                % Yr[k] of length N!
Yr((N/4)+1:(3*N/4)) = Ya((N/4)+1:(3*N/4));  % Assign nonzero coefficients

% part 3:
yr = real(ifft(fftshift(Yr)));  % RECONSTRUCT the filtered signal.
                                % Take REAL part for convenience.
figure,plot(-f/2+f/N:f/N:f/2, abs((Yr)));

% part 4:
sound(yr,f,16);                 % Listen to the reconstrcusted audio