Skip to main content

Posts

Stretch the dynamic range of the given 8-bit grayscale image using MATL...

Recent posts

How can I ensure that when I click the play button more than once in my MATLAB GUI

  How can I ensure that when I click the play button more than once in my MATLAB GUI, the audio is played only once, regardless of how many times I press the play button? I am making an audio equalizer in MATLAB guide. When I press the 'play' button more than once, it plays the audio signal as many times as I've pressed the button. What I want is that when I press the play button more than once, it should only play the audio signal once.   The code for play button is given below:   % PLAY BUTTON function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) audiofile = handles.fullpathname; % the input audio file is stored in "audiofile" variable. [x, fs] = audioread(audiofile); guidata(hObject, handles); handles.CP=1; % Storing the value of slider in respective variables. slider_1 = get(

I need to isolate certain values of a matrix based on whether

  I need to isolate certain values of a matrix based on whether one of the values fall in a certain range I am writing a word recognition program that takes an array from 'audioread' and applies a few methods to it to get a frequency spectrum. This spectrum is saved into a cell aray with each cell containing the frequency peaks for a quater of the word at a time.   So for each word it returns a 4x1 cell array. Each of these cells need to be further subdivided to frequency bands An example of one such a cell follows     % ans = 2×2 % 24.9843526628176 32 % 5.44020124026728 62 The first column indicates amplitude and the second indicates the index. I need to split the matrix into divisions that are 30 wide each. So all 2nd column values from 0 to 30 must be together and all from 30 to 60 etc. All the way up to 300.   The following code exert is the function that I wrote for this application for context to the question. It is probably f

How to put an audio file through a filter made through matlab

  Hi, I'm wondering how I can place a sound file through a filter that I made through Matlab. The code works, I'm just wondering how to inject the audio file through the filter itself. I believe it should be some application of the fir1 command, though I'm not sure how to impliment it fully. The code is as follows:   Fl = 300 Fh = 3400 Samples = 44100 Wc = [Fl Fh]./Samples bbp = fir1(256, Wc, 'band'); figure(1) plot (1:length(bbp), bbp) figure(2) freqz(bbp,1) outbp = filter(bbp,1,y); audioread('song.wav'); info = audioinfo('song.wav') filename = 'song.wav'; [y,Fs] = audioread('song.wav'); audiowrite(filename,y,Fs); sound(y,Fs) And I am looking to filter song.wav with the bandpass filter I made, rather than the default fir1 command one. Thanks for the help NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches

How to plot the frequency spectrum graph in high-pass filter Blackman windowing method?

  Hi everyone, I want to plot the frequency spectrum graph of an original audio signal by using this code:   %input audio file with format: *.wav [samAud, samRate]=audioread('Toto_Africa.wav'); N=200; f=0:samRate/(N/2-1):samRate; samAud_fft=fft(samAud,N); %plot audio file in time domain figure(1) plot(samAud); %plot original audio signal in time domain %plot audio file in frequency domain figure(2) plot(f,abs(samAud_fft(1:N/2))/max(abs(samAud_fft(1:N/2)))); xlabel('Frequency (in hertz)'); However, I have trouble where the graph is only showing like this: Could somebody help me troubleshoot this problem? NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learn

How to obtain the same output in spectral descriptors, using frequency and time domain inputs?

  All matlab spectral descriptors as spectralSlope, spectralKurtosis,ect have the choice to use a time domain or a frequency domain input, but I'm unable the get the same (even aproximadetly) result, does anyone knows how to solve this?   Example:     clear; %load an audio [x,fs]=audioread('example.wav'); %windowing data win=round(0.025890625*fs); over=round(0.01875*fs); % 72% %Obtain the spectral data [s, f, t]=spectrogram(... x,... hamming(win),... over,... win,fs,'yaxis'); slope_normal(:,1)=spectralSlope(x,fs, Window=hamming(win),OverlapLength=over); slope_spec(:,1)=spectralSlope(s,f); figure;plot(slope_normal);hold on;plot(slope_sub);   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guara

How can i add PSNR, MSError and SNR to my ready code?

  Hello everyone, I'm doing research on an assignment that does LPC compression to a Speech file.   Here you see the code;   clear all; clc; %TAKING INPUT WAVEFILE, a1 = 'C:\Users\user\Desktop\WAV\a1.wav'; [y, Fs] =audioread(a1); % x=wavrecord(,); %LENGTH (IN SEC) OF INPUT WAVEFILE, t=length(y)./Fs; sprintf('Processing the wavefile "%s"', a1) sprintf('The wavefile is %3.2f seconds long', t) %THE ALGORITHM STARTS HERE, M=10; %prediction order [aCoeff, pitch_plot, voiced, gain] = f_ENCODER(y, Fs, M); %pitch_plot is pitch periods synth_speech = f_DECODER (aCoeff, pitch_plot, voiced, gain); Additionally, I want this code to calculate PSNR, MSError and SNR.   dis=numel(y)-numel(A2); A2=[A2,zeros(1,dis)]; PSNR = psnr(A2,y) MSError=mse(A2,y) SNR=snr(A2,y)   I found such a code on the internet. But I don't know what I should write instead of "A2" or for the others. NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, M