Matlab Signal Analysis - frame by frame analysis of a signal - silence removal audio example.avi

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • Shows silent frames can be removed from an audio signal by analysing the signal on a frame by frame basis

Комментарии • 77

  • @ddorran
    @ddorran  11 лет назад +3

    1) Yes. frame_len (samples) = fs(samples per second) * frame_dur(seconds). If the frame_dur was 10ms and fs =22050Hz then frame_len = 220 (rounding since you can't have a non-integer number of samples).
    2) To save reduce file size. You loose higher frequecies when you sample at lower frequencies. Telephony systems sample at 7kHz - listening to someone on the telephone sounds different to listening to someone on the radio.
    3) Unit is Hz, but can be expressed in kHz for convenience.

  • @Dr.alphonceowayo
    @Dr.alphonceowayo 3 года назад

    Wow I like this video. Kind of similar to signal filtering, which I am about to apply for my research and I was just wondering how.You are a savior.

  • @ppsaraswathi4627
    @ppsaraswathi4627 7 лет назад

    very nice and useful presentation sir.thank you very much

  • @deepaksujith
    @deepaksujith 9 лет назад

    Superb imposing of sound !!!!
    great

  • @Tuesander
    @Tuesander 8 лет назад

    Hi David,
    amazing vids. You are saving my life one video at a time.
    One question:
    If I want to gate the silence instead of removing it how do I go about it?
    Thinking it should be simple since the "for loop" already has set the max_val in each frame.
    Kind regards

    • @ddorran
      @ddorran  8 лет назад

      I'm afraid I don't understand what you mean by gating the silence. If you can clarify and upload an attempt I'll take a look

    • @Tuesander
      @Tuesander 8 лет назад

      Yes, I mean a gate like the plugins used in digital audio workstations. Where you set a threshold and don't allow audio below that threshold to pass through. Basically turning down the volume when there is pauses instead of removing it.

    • @janm.4496
      @janm.4496 7 лет назад

      Tuesander I'd say you could do it by reversing the symbol in the "if" and put zeros in the while frame. Probably

  • @khinezar1629
    @khinezar1629 7 лет назад

    Thank you so much ! Your video is so useful for me......

  • @TheAhmadob
    @TheAhmadob 7 лет назад

    that's very good, by why did you have to breakdown the signal into frames? Why didn't you just loop over the whole length of the signal and whenever the threshold condition is met, you write that into new_sig ?

  • @heysiri289
    @heysiri289 5 лет назад +3

    you saved my life, thank youuu

  • @ibrahimallafi1460
    @ibrahimallafi1460 3 года назад

    Thank you alot
    IS the frame by frame analysis the same Sliding Window?

  • @Hana-cv7ze
    @Hana-cv7ze 10 лет назад

    Thank you for this video! It helped a lot!

  • @meenas2754
    @meenas2754 7 лет назад

    Greetings sir, can I ask you a question? What part of audio is non sensitive?? That means if we change some values in audio it should not affect that audio.. which part can I change? Thanks in advance

  • @xyz8869
    @xyz8869 7 лет назад

    sir, kindly answer to this question:
    how can we separate silent speech on the basis of energy of each frame instead of calculating the maximum amplitude of each frame?

  • @RoadsAndTraffic
    @RoadsAndTraffic 6 лет назад

    i would like to process an audio signal using MATLAB, i should break the time series data into several segments (suitable for microcontroller memory limit) and do the signal processing step by step. could you give the idea please how to that?

  • @musadiness1
    @musadiness1 10 лет назад

    thank you for the tutorial! I think you can optimize like this with 2 for cycles instead of removing the silence at the end:
    count = 0;
    for k=1 : number_frames
    frame = x( (k-1)*frame_len +1 : frame_len*k);
    max_val = max(frame);
    if (max_val>0.04)
    count = count +1;
    end
    end
    new_signal = (count) %creation of the new signal with the proper size
    for k=1 : number_frames
    frame = x( (k-1)*frame_len +1 : frame_len*k);
    max_val = max(frame);
    if (max_val>0.04)
    count = count +1;
    new_signal((count-1)*frame_len +1 : frame_len*count)=frame;
    end
    end

  • @beantish
    @beantish 11 лет назад +1

    Great tutorial, do you have any tutorials on speech analysis/synthesis using linear predictive coding (lpc)? It would be of really great help.
    cheers.

    • @Error_.404
      @Error_.404 3 года назад

      hey hello I know it was 7 years ago but did you find something about coding LPC because this is exactly what I have to do for ma project pleaase

  • @MrArammos
    @MrArammos 9 лет назад +1

    I think it should be better to write it as follows:
    for i = 1:num_frames
    frame(:, i) = x( (i - 1) * frame_len + 1 : frame_len*i);
    end
    Excuse me if i'm wrong i'm new to Matlab and signal processing :)

    • @ddorran
      @ddorran  9 лет назад

      I don't see the benefit. Why do you think its better?

  • @kwakuowusuboateng4399
    @kwakuowusuboateng4399 3 года назад

    Great tutorial David. Please, can you help me with a plot of Short Term Energy (STE) of signal and number of frames. Also, please how do you show e.g. 10 frames with all signals showing in a single plot

  • @matinkaviani801
    @matinkaviani801 4 года назад

    Hi, thank you for your informative video. As I'm new to audio processing, can I ask why You took 22050 as the sampling rate?

    • @ddorran
      @ddorran  4 года назад

      The sampling rate will be specified in the wav file. 44100, 22050, 16000, 8000 Hz would be common for audio data.

  • @yehiaelyamani6943
    @yehiaelyamani6943 7 лет назад

    great video!

  • @darkobul1
    @darkobul1 8 лет назад

    Is it possible to define new_sig to grow with added frames instead of predefined zeros(N,1)? Like array in other programming languages

  • @brendanvanbiljon3861
    @brendanvanbiljon3861 9 лет назад +2

    Hi great tutorial. I used this code to count from 1 to 10. Can you please show me how to extract each word separately and the play each number one by one?

  • @kewlaldo10
    @kewlaldo10 4 года назад

    Can this be done to a fourier transform as well? How would you do it?

  • @russtyglifonea2840
    @russtyglifonea2840 11 лет назад +1

    hello sir!!!...
    how can i extract the green channel in a pixel processing?
    can i get the sample of a codes of how to extract?thanks :)))

  • @DiegoCarvacho
    @DiegoCarvacho 7 лет назад

    That was good! thank you!!

  • @FuckenMoonFace
    @FuckenMoonFace 9 лет назад

    if i want to apply this to a real time speech and i want to cut out the empty part of the signal what should i do ...
    in you code its possible to cut out the beginning of the signal but i want to cut out the empty end part as well and plot the new signal with out empty values.
    clc
    close all
    y=audiorecorder(8000,8,1);
    disp('start');
    %recording time 1.5
    recordblocking(y,1.5);
    disp('end');
    z=getaudiodata(y);
    subplot (2,1,1);
    plot(z);
    xlabel('original signal');
    %sampling frequency =8000
    fs = 8000;
    %FAME DURATION = 32ms
    frame_duration = 0.032;
    frame_len = frame_duration * fs
    %FRAME LENGTH = 256
    n = length(z);
    num_frames = floor(n/frame_len)
    new_sig = zeros(n,1);
    count = 0;
    for k = 1:num_frames
    frame = z((k-1)*frame_len+1 : frame_len *k);
    max_val = max(frame);
    if (max_val>0.05);
    count = count + 1 ;
    new_sig((count-1)*frame_len+1 : frame_len*count) = frame;
    end
    end
    %remove the end sielent part of the speech
    %new_sig(80000:end) = [];
    subplot(2,1,2)
    plot (new_sig);
    xlabel('the new signal');
    sound(new_sig,8000);

  • @babamusaabbagoni3638
    @babamusaabbagoni3638 11 лет назад

    Thanks very much!

  • @MrArammos
    @MrArammos 9 лет назад

    I have a question on how to break our signal into frames, i'm running your script and frame is a 1xframe_len vector. I think that the way you wrote it extract only the last frame. We want for our frame to be a num_frames x frame_length matrix not a vector i think

    • @ddorran
      @ddorran  9 лет назад +1

      I see what your other comment means now. That code seems good to me if you want to store each frame.

    • @MrArammos
      @MrArammos 9 лет назад

      David Dorran Thanks a lot David :)

  • @rock95raw33
    @rock95raw33 6 лет назад

    thanks for the great stuff man seriously WOWs!! :)...i'd like to ask u how to detect a tone embedded in speech using matlab ???? plz help man what to do exactly i dont know !!!

  • @monakhalil8922
    @monakhalil8922 9 лет назад +1

    hey ..
    how can I find the max value for the silence frames without looking to the graph ?

    • @ddorran
      @ddorran  9 лет назад

      The following gets the maximum value in a frame:
      max_val = max(frame)
      put this line of code inside the IF statement to find the max of each 'silent' frame

    • @monakhalil8922
      @monakhalil8922 9 лет назад

      David Dorran thank you but how can I show it as an output coz it's not workin with me !

    • @ddorran
      @ddorran  9 лет назад

      Mona khalil Post your code and I'll take a look

  • @KansasFashion
    @KansasFashion 6 лет назад +1

    Why I couldn't use wavread. When I type ip = wavread('file'). It says that wavread is undefined and when I type help wavread, it doesn't work at all....

    • @ddorran
      @ddorran  6 лет назад

      use audioread - it replaced wavread

    • @KansasFashion
      @KansasFashion 6 лет назад +1

      Thanks so much!! You are really awesome.

  • @vickysteev8964
    @vickysteev8964 8 лет назад

    Hi, i am Vicki
    Right now i am learning matlab, but i am just begginer at matlab, right now i want to learn about how to using low and high pass filter, Savitzky-Golay Filtering (SGOLAYFILT), mean and varians, and also find out the peak and valley point from the gyro and accelerometer signal, and all my data i get from excel.
    can You give me some tutorial or code how to make it
    I really hope You can help me to figure it out
    Best Regards
    Vicki

  • @rohanpatil2529
    @rohanpatil2529 10 лет назад

    Hi David
    I would like to know, why sampling frequency was choosen as 22050(fs). Please let me know the exact reason.
    Thanks.

    • @ddorran
      @ddorran  10 лет назад +1

      Its a common sampling rate used to capture audio signals. While we can hear up to about 22kHz most of the "useful" auditory information is in the lower frequencies (from an intellibility perspective). This is why CD quality is 44kHz but also why we can get away with using lower sampling rates (like 8kHz for telephony).

    • @khinezar1629
      @khinezar1629 7 лет назад

      is it ok if i choose 11025 sampling frequency for environmental sounds like door knock and keyboard typing ? please explain me...

  • @derrickp1345
    @derrickp1345 11 лет назад

    Please could you tell me what this does in the program
    count = count + 1;
    new_sig((count-1)*frame_len+1:frame_len*count) = frame;

  • @AdityaSingh-yx3ky
    @AdityaSingh-yx3ky 11 лет назад

    sir, will u please tell me about the mfcc of a audio signal, means how to calculate the mfcc of a audio signal

  • @MrNextboy
    @MrNextboy 11 лет назад

    Hi David,
    All values of my new_sig is 0.
    I think something is wrong with vector new_sig.
    Can you help me?

  • @shinygene8486
    @shinygene8486 10 лет назад

    Instead of identifying silence, how to identify the maximum amplitude/peak frame by frame? Hope to get reply from you soon. Thanks.

    • @ddorran
      @ddorran  10 лет назад +1

      The following gets the maximum value in a frame:
      max_val = max(frame);

    • @shinygene8486
      @shinygene8486 10 лет назад

      I see. Let's say the graph is plot against amplitude and time(in seconds),
      how to specify the time (automatically without zooming in to find the time) where the max-value is? Thank you so much for your help.

    • @ddorran
      @ddorran  10 лет назад +2

      [max_val max_loc] = max(ip);
      frame_len = 100;
      seg = ip(max_loc - frame_len/2:max_loc + frame_len/2);
      plot(seg)

    • @shinygene8486
      @shinygene8486 10 лет назад +1

      Thank you so much and your fast response.

    • @shinygene8486
      @shinygene8486 10 лет назад

      hi David, can i check with you how do we find the max_loc?. Thanks

  • @sarahramadan2564
    @sarahramadan2564 9 лет назад

    where can ifind the m_file and the darryl video

  • @TopVideos-ts2cp
    @TopVideos-ts2cp 6 лет назад

    when i type waveread and audioread it says undefined for both can u please tell what is problem???

    • @naveenchawla70
      @naveenchawla70 5 лет назад

      i m facing this problem too? did u get solution of it ?

  • @saranyagopal9131
    @saranyagopal9131 9 лет назад

    how to get max_value without looking the graph

  • @BHARGAB1000
    @BHARGAB1000 10 лет назад +1

    thanks..

  • @princessgenes
    @princessgenes 11 лет назад

    can you also tell me how to convert the new signal back into a .wav file??

  • @adembagi
    @adembagi 10 лет назад

    hello mr dorran firstly ı want to thanks you so much for your sharing this videos help to me so much have you fır filter codes for speech recognition thanks again you are good man :)

  • @MuhammadAsim-mh4xo
    @MuhammadAsim-mh4xo 7 лет назад

    is this work published?

  • @mariemabdelhaye1079
    @mariemabdelhaye1079 7 лет назад

    slvp comment je peux afficher le fram

  • @ParthRajSingh
    @ParthRajSingh 10 лет назад

    can we use new_sig=ip(ip>.03) ?

    • @ddorran
      @ddorran  10 лет назад +1

      Not exactly sure what you are trying to do but I think new_sig = ip(find(ip>0.03)) might be what you are looking for. This will just create a new_sig variable which contains all samples greater than 0.03

    • @ParthRajSingh
      @ParthRajSingh 10 лет назад

      Yes i was trying to do same as new_sig = ip(find(ip>0.03)) , it works without 'find' method. Basically I am looking for the optimum frame length for assuming sound signal as wide sense stationary to calculate cross correlation.

  • @ddorran
    @ddorran  11 лет назад

    wavwrite(new_sig, 22050, 16, 'speech.wav')

  • @sbkyoutu
    @sbkyoutu 8 лет назад

    buffer is enough

  • @rock95raw33
    @rock95raw33 6 лет назад

    thanks for the great stuff man seriously WOWs!! :)...i'd like to ask u how to detect a tone embedded in speech using matlab ???? plz help man what to do exactly i dont know !!!

  • @rock95raw33
    @rock95raw33 6 лет назад

    thanks for the great stuff man seriously WOWs!! :)...i'd like to ask u how to detect a tone embedded in speech using matlab ???? plz help man what to do exactly i dont know !!!

  • @rock95raw33
    @rock95raw33 6 лет назад

    thanks for the great stuff man seriously WOWs!! :)...i'd like to ask u how to detect a tone embedded in speech using matlab ???? plz help man what to do exactly i dont know !!!