Skip to main content

Posts

Showing posts from March, 2024

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

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

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

How to create a pulsing sound/use duty cycle

  Im trying to recreate the busy tone on matlab, the tone will have 60 interruptions per minute (50% duty cycle) and I already have the dual tone frequency set. The issue is I have no idea how to make the audio pause 60 times per minute without a long code or looping. Is there a way to utilize the duty cycle to make this easier or shorter, or do I settle with a loop?     Fs = 8000; %# Samples per second tone1 = 480; %# Tone 1 frequency, in Hertz tone2 = 620; %# Tone 2 frequency, in Hertz nSeconds = 2; %# Duration of the sound y = sin(linspace(0, nSeconds*tone1*2*pi, round(nSeconds*Fs)))... % Dual tone frequency + sin(linspace(0, nSeconds*tone2*2*pi, round(nSeconds*Fs))); %...   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.Te

How to find word error rate of spoken sentence for regression based model?

  I am working on visual speech synthesis. I have used GRID dataset which consists of short sentences. The developed model is regression based model.The model takes mute video as a input & generate speech signal. My aim is to find word error rate from output signal(speech signal). I don't know how to seperate words from input and output signal in order to find word error rate. 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 learning and research. Word Error Rate (WER) is a widely used metric for evaluating Automatic Speech Recognition (ASR). To calculate WER for a visual speech synthesis (VSS) system, a reference word transcription and a hypothesis word transcription

Guidance for importing a .wav audio file into MATLAB for digital filter simulation.

  Dear All,   I hope this message finds you well. I am currently working with Altera FPGA Cyclone IV and aim to implement a FIR filter for the ADC data originating from a microphone. Quartus provides an IP core (FIR II) for this purpose, and I intend to implement the coefficients generated with Matlab FilterDesigner.   More specifically I record for 2 seconds the sound from a microphone but when I choose to play the recording it has a lot of noise.   I would like to inquire if it's possible to import a .wav audio file into MATLAB for simulation and testing. I aim to fine-tune the filter and subsequently proceed to FPGA. Could you please guide me on the necessary steps to import the audio file, pass it through the digital filter, and observe the results in MATLAB?"     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, C

How can I add a low pass filter after each delay line in my multi channel feedback delay network

  Im about to program this structure in Matlab in a for loop   So far so good. And I have already done the for loop. I also implemented a Hadamard Mixing Matrix. Here is the code:     in = [ 1; 0 ]; % Dirac Impulse Fs = 44100; in = [in; zeros(3*Fs,1)]; % Space for reverb % Define delay parameters %Hadamard Matrix as feedback matrix H = 0.75*hadamard(16); feedbackGain =[0.1,-0.15,-0.2,0.25,-0.3,0.35,0.4,-0.45,-0.5,0.55,0.6,-0.65,-0.7,-0.75,-0.8,0.85]; %0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85 wetGain = [0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7]; % adjust to control wet signal level % Convert delay time to samples delaySamples = [101,233, 439,613, 853,1163, 1453,1667 , 1801,2053, 2269,2647, 3001,3607, 4153,4591]; %0.02s, 0.03, 0.04, 0.05 881, 1009, 1321,1511, 1777, 1999, 2203, 2351 %101, 439, 853, 1453 , 1801, 2269, 3001, 4153 %Summe delays = 30644 % delaySam