title: Fourier Transform Of male and female voice
body: <p>I'm doing fourier transform using matlab R2014a, first I have read two audio files of femal and male, then I initialized the magnitude and phase for each. A Task in my report requires to Mix female speech amplitude with phase spectrum of the other signal-male phase-, or viceversa, So I wrote a code and I keep getting this error: </p>
  
  <pre><code>Error using  * 
  Inner matrix dimensions must agree.
  out1 = Mag_Male*exp(1i*Phase_Fem);
  </code></pre>
  
  <p>And even using.*</p>
  
  <pre><code>Error in Untitled9 (line 183)
  out1 = Mag_Male.*exp(1i*Phase_Fem);
  </code></pre>
  
  <p>or .* in both operators </p>
  
  <p><strong>The full error</strong> </p>
  
  <pre><code>&gt;&gt; Untitled9
  Error using  .* 
  Matrix dimensions must agree.
  Error in Untitled9 (line 183)
  out1 = Mag_Male.*(exp(1i.*Phase_Fem));
  </code></pre>
  
  <p><strong>Output of m and f size using size function</strong></p>
  
  <p><strong><em>code:</em></strong> </p>
  
  <pre><code>maleAudio_row = size(m);
  femaleAudio_row = size(f);
  display(maleAudio_row);
  display(femaleAudio_row);
  </code></pre>
  
  <p><strong><em>Output:</em></strong></p>
  
  <p>maleAudio_row =</p>
  
  <pre><code>  119855           2
  </code></pre>
  
  <p>femaleAudio_row =</p>
  
  <pre><code>  119070           1
  </code></pre>
  
  <p>although my other colleagues worked fine with them :(</p>
  
  <p>This is my Code: </p>
  
  <pre><code>Fs = 11025;
  Ts = 1/Fs;
  t = 0:Ts:0.1;
  [m, Fs]=audioread('hamid1.wav');
  [f, Fs]=audioread('myvoice.wav');
  player = audioplayer(m,Fs);
  player2 = audioplayer(f,Fs);
  %play(player2);
  %---- Frquency Domain Sampling-----%
  Fem = fft(f);
  Phase_Fem = angle(Fem);
  Mag_Fem = abs(Fem);
  %-----------------------------------%
  Male = fft(m);
  Mag_Male = abs(Male);
  Phase_Male = angle(Male);
  %-----------------------------------%
  out1 = Mag_Male*exp(1i*Phase_Fem); % this step for putting female phase on male  mag.
  out2 = ifft(out1); % this step is convert the previus step to time domain so i can     
  %play the audio
  Nx = length(out2);
  F0 = 1/(Ts*Nx2);
  result = audioplayer(out2); 
  play(result);
  </code></pre>