Skip to main content

Posts

Showing posts from December, 2020

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

Similarity of two .wav files - unsure about the returned error.

  Hi, I'm wanting to use correlation to see how similar an original sound and one I synthesized from it are. I was advised to use the resample function however, due to lack of knowledge in MATLAB I'm looking for a little help to gain my metric as I'm just not understanding things. I have attached the audio files if anyone could please help me out a little?   clear, clc, close all % get a section of the sound file [x, fs] = audioread('Machine_Gun.wav'); % load an audio file x = x(:, 1); % get the first channel N = length(x); % signal length t = (0:N-1)/fs; % time vector [y, fs] = audioread('Dry_Synthesized_Machine_Gun.wav'); % load an audio file y = y(:, 1); % get the first channel n = length(y); % signal length T = (0:n-1)/fs; data = [x y]; correlation = corrcoef(data); This was my failed attempt and i got the below error message: Error using horzc

Speech Command detection in audio file

  I need to remake  "Speech Command Recognition Using Deep Learning"  example so I can read audio  from the wav file  and get time intervals in which the command appears, but I don't know how to change real-time analysis from microphone into static file analysis in this example. Thank you for your help. %% Detect Commands Using Streaming Audio from Microphone % Test your newly trained command detection network on streaming audio from % your microphone. If you have not trained a network, then type % |load('commandNet.mat')| at the command line to load a pretrained network % and the parameters required to classify live, streaming audio. Try % saying one of the commands, for example, _yes_, _no_, or _stop_. % Then, try saying one of the unknown words such as _Marvin_, _Sheila_, _bed_, % _house_, _cat_, _bird_, or any number from zero to nine. %% % Specify the audio sampling rate and classification rate in Hz and create % an audio device reader that can read audio

PWELCH vs PSD

  I am trying to update some code that uses the deprecated function PSD to use PWELCH instead; however, I am getting completely different results when I am using what seems to be the same parameters. Does anyone know why? Here are what I believe to be the equivalent function calls:   [pxx,f] = pwelch(data, hanning(1024), [], 1024, 250); [pxx,f] = psd(data,1024,250,hanning(1024)); Where: data = signal in a vector       hanning(1024) = window vector 1024 = nfft, number of points in the fft 250 = Fs, the sampling rate [ ] = noverlap, defaults to 50% window overlap Matlab  has removed all help information for the PSD function, and instead says to use its functional equivalent pwelch, so I don't have anyway of looking up what the original documentation says about the function's inputs and outputs. Could the outputs be scaled differently? Is the PSD calculated differently between the two functions? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, Ma

Use of modalfrf for operating measurements

  I need to calculate the FRF for a mechanical system where the exitation has its origin from a gearbox. I generated  simulation  data while the mechanical systems rotates under operating conditions. I generated data of velocity an acceleration. For my acoustical analysis I need the frequency response function. So I wanted to calculate them by using the function modalfrf. But I am not sure if I can use this function due to the fact that I do not have a hammer or shaker exitation. So is it possible to calculate the FRF with this function or do I need to use another function?  ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. This is essentially a system identification problem. You h

Is 2020a Network-Named User license backwards compatible for older versions

  Currently I have the license server with a license file for 2019a installed on my server for network-named users. I would like to upgrade it to a newer 2020a license file. Will the network-named users that are currently using 2019a still be able to continue using their version or will they need to upgrade to 2020a as well? Basically, can I use older versions of   Matlab  with a newer license file on my license server? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. Yes, newer license servers are backwards compatible (provided that you do not need "Bug-for-bug" compatibility)

How to number the peaks and troughs of signal ?

  Here is my signal where i need to number the peaks and troughs in numbers as 1,2,3,4... ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. Try findpeaks() in the  Signal Processing  Toolbox. Invert the signal to find valleys.     numPoints = 50; x = sort(rand(1, numPoints)); y = rand(1, numPoints); plot(x, y, 'k-', 'LineWidth', 2); grid on; [peakValues, indexesOfPeaks] = findpeaks(y); hold on; peakx = x(indexesOfPeaks); peaky = y(indexesOfPeaks); plot(peakx, peaky, 'r*', 'LineWidth', 2, 'MarkerSize', 10); % Find valleys on inverted signal SEE FULL ANSWER CLICK LINK https://www.matlabsolutions.com/resources/how-to-number-the-peaks-and-tro

How to design multirate filter system for EMG signals

  I am using Delsys Bagnoli EMG System to acquire sEMG from forearm muscles. When I use Delsys EMGworks application, output signals are clean as expected with minor interferences. However, when I use the following Matlab script to acquire the   signal   unusual signal pattern occured (spikes). the image of frequency domain of the Data (Red color frequencies contains EMG information) acquired from Matlab script is attached herewith. I want to know why this happens and how to remove thoses spikes the  Matlab script: %% EMG initialize raw = zeros(1,6); % EMG setup emg = daq.createSession('ni'); ch1 = addAnalogInputChannel(emg, 'Dev1', 0, 'Voltage'); ch2 = addAnalogInputChannel(emg, 'Dev1', 1, 'Voltage'); ch3 = addAnalogInputChannel(emg, 'Dev1', 2, 'Voltage'); ch4 = addAnalogInputChannel(emg, 'Dev1', 3, 'Voltage'); ch5 = addAnalogInputChannel(emg, 'Dev1', 4, 'Voltage'); ch6 = addAnalogInputChannel(emg,

Single sided spectrum of vector y obtained using fft

  how to   plot  a   single   sided spectrum of vector y obtained using fft? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. The way I usually calculate and plot it:     t = linspace(0, 1, 1E+4); s = sum(sin([0; 100; 200; 300]*2*pi*t*10)) .* randn*10; Ts = mean(diff(t)); % Sampling Interval Fs = 1/Ts; % Sampling Frequency Fn = Fs/2; % Nyquist Frequency L1 = numel(t); FTs1 = fft(s)/L1; % FFT Of Original Signal Fv1 = linspace(0, 1, fix(L1/2)+1)*Fn; % Frequency Vector Iv1 = 1:numel(

Remove noise parts in the signal

  How could I remove the noise from a mat file? The fs is 30 Hz. I tried to use a low pass filter, but seem not work well. I am not good at  programming matlab. Could you fix my code and explain that? clear all; load('examples.mat'); n = 57; y = examples(n).data; figure(1) grid on; plot(y); xlabel('Times'); ylabel('Amplitude'); title('Original Noisy Signal'); fs = 30; fpass = 3; yf = lowpass(y, fpass, fs); figure(2) grid on; plot(yf); xlabel('Times'); ylabel('Amplitude'); title('Filtered Signal'); ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. The problem is that your   signal  displa

How to plot this eqaution?

  can any one create a   matlab code   for   ploting  this ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. t=0:.001:1.0; s4 = cos(80*pi*t-10*pi).*(t>0.5 && t<=1.0);

How to know which plot is more linear then the other?

  Dear all, I have two  datasets arrays :   A = [0 0.423891532 0.819380304 1.289479809 1.739548357 2.288748183 2.8990623 3.618974647 4.402757506 5.268816221 6.240886445 7.278958674 8.321358342 9.369407383 10.37825178 11.17417756 12.02774088 12.69808163 ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. You can see the residual error with linear fit to see which dataset is more linear   [~, eA] = polyfit(1:numel(A), A, 1) [~, eB] = polyfit(1:numel(B), B, 1) Result >> eA.normr ans = 4.0713 >> eB.normr READ MORE : https://www.matlabsolutions.com/resources/how-to-know-which-plot-is-more-linear-then-the-other-.php

How to count the maximum and minimum range of non-zeros elements?

  let's suppose we have A of length 50 rows how we can calculate the maximum range of non-zeros element and as well as minimum A = [0 0 1 1 1 1 0 0 0 0 0  1 1  0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0  1 1 1 1 1   0 0 0 0 ] In this case Max and Min should be, Max = 5 Min = 2   Is there a straightforward solution to do this? without using complex looping because in my case data is too large approximately length of A is 220079705, your kind consideration will be highly regarded by all means, ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. A = [0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 ] props = regionprops

Zero pad vectors within cell array to make them equal length

  I have a cell array with vectors  y1, y2, y3, y4, y5  which are of variable lengths. I get the maximum length among all elements in the  cell array  using:   sigvecarray = {y1, y2, y3, y4, y5}; [maxsamples, idx] = max(cellfun(@numel, sigvecarray)); Now, I need to zero pad the shorter vectors with the differrence from maxsmaples and their own sample numbers. I tried the following first:   signalvectors = {} for k = 1:numel(sigvecarray) currveclength = length(sigvecarray{k}) if currveclength < maxsamples padding = samples - currveclength signalvectors{k} = [sigvecarray{k}, zeros(padding, 1)] end end It gave me the follwing error:       Error using horzcat Dimensions of matrices being concatenated are not consistent. Then I tried the solution from the post here as follows: origsamplesarray = cellfun(@numel, sigvecarray); padfun = @(k) [sigvecarray{k} zeros(maxsamples(k) - origsamplesarray(k), 1)] ; signalvectors = arrayfun(padfun, 1:numel(sigvecarray) , &#