Matlab audioread & audiowrite problem

Discussion in 'Programmer's Corner' started by Noy Uzrad, May 14, 2017.

  1. Noy Uzrad

    Thread Starter New Member

    May 14, 2017
    4
    0
    hi

    I have a double data-type array.
    when I write it into wav audio file using audiowrite, and later read it using audioread, i get different values from the original array.
    they are both double, but still, values are different.

    any ideas?
     
  2. MrChips

    Moderator

    Oct 2, 2009
    16,734
    5,131
    Can you post your MATLAB code?
     
    Noy Uzrad likes this.
  3. Noy Uzrad

    Thread Starter New Member

    May 14, 2017
    4
    0
    the values in wmed_signal1 and eval_signal_en are very close, but still differ.
    I need them too be exactly the same
     
  4. MrChips

    Moderator

    Oct 2, 2009
    16,734
    5,131
    Can you cut and paste the code as simple text?
     
  5. Noy Uzrad

    Thread Starter New Member

    May 14, 2017
    4
    0
    audiowrite('wmed_signal1.wav' , wmed_signal1, Fs);

    eval_signal_en = audioread('wmed_signal1.wav')';
     
  6. MrChips

    Moderator

    Oct 2, 2009
    16,734
    5,131
    Apparently audioread and audiowrite are using different formats or is doing some signal processing to the data.
    What is your sampling frequency Fs?
    Do you still have wavread and wavwrite on your version of MATLAB?
     
  7. Noy Uzrad

    Thread Starter New Member

    May 14, 2017
    4
    0
    OK fellows I had figured it out.
    I had to add the arguments ('BitsPerSample', 64) to audiowrite function.

    Thank you for your replys
     
Loading...