Answered
FIR Parks-McClellan
You don't want to use spectrogram, use freqz() freqz(FR_SV,1) If you know the sampling frequency, you can input that as ...

14 years ago | 0

Answered
Code for CorrCoef without using inbuilt function
The code for corrcoef is open for you to look at. Can't you use that as a basis for your implementation?

14 years ago | 0

Answered
align created random numbers in an array
Y = [0.3, 0.7, 0.8]; U = [0.1 0.2]; Y = cat(2,Y,U); or just Y = [Y,U]; So for example: N = [3 4 5]; ...

14 years ago | 1

| accepted

Answered
trying to find peaks on a time series
Then please compare: x = [2 12 4 6 9 4 3 1 19 7]; [pks,locs] = findpeaks(x); % here is your code newx=zeros(lengt...

14 years ago | 0

Answered
Wrong amplitude values after the FFT
The main issue you have is that you are only randomly sampling from a small set of frequencies and you are doing that 18 times, ...

14 years ago | 0

| accepted

Answered
trying to find peaks on a time series
I'm assuming that xn in your loop above is the signal. You don't show us where xn comes from and it's not used in your call to f...

14 years ago | 0

| accepted

Answered
Measure the degree of Periodicity
You can use the cepstrum. There is a technique called "cepstral peak prominence" that is used to analyze voice quality. The basi...

14 years ago | 1

Answered
plot autocorrelation
x = randn(1000,1); % 1000 Gaussian deviates ~ N(0,1) y = filter([1 -1 1],1,x); % Create an MA(2) proce...

14 years ago | 5

| accepted

Answered
Xcorr - plot correlation across time.
t = 0:0.001:1-0.001; x = cos(2*pi*100*t)+randn(size(t)); y = sin(2*pi*100*t)+randn(size(t)); [xc,lags] = xcorr(x,...

14 years ago | 0

| accepted

Answered
How to extract a string name from a cell array and use it as name for a new variable?
Are you sure you want them to input the temperature as a string? A={'wind force', 'temperature', 'humidity'}; temp...

14 years ago | 0

Answered
SNR in AWGN
With the syntax y = awgn(x,snr); You generate a white noise vector with a variance of variance = 10^(-snr/10); ...

14 years ago | 3

Answered
Confused about num2str function
Hi, here is an example: for nn = 1:10, plot(randn(100,1)); title(['plot' num2str(nn)]); pause(0.5); end

14 years ago | 0

| accepted

Answered
multiple periodograms
Just do [Pxx2,w] = pwelch(y2); Or any legal variable name. MATLAB variable names must start with a letter followed by ...

14 years ago | 0

| accepted

Answered
no degree symbol
plot(randn(100,1)); title('360^\circ')

14 years ago | 0

Answered
Finding x for when y equals a certain value
Say x is your x-vector, and I'll let y be your pressure readings, would the following work? I'll make the threshold 2 in this ex...

14 years ago | 1

| accepted

Answered
How to Compare the lengths of vectors
Not sure why you want to pad the DFT in this case, you end up not getting accurate frequency estimates by doing that. Fs = ...

14 years ago | 0

Answered
Error with atan?
As Walter states in his comment, I'm guessing you should use atan2() so you can tell the difference between (1,-1) and (-1,1) ...

14 years ago | 1

Answered
Matrix Filling
index = find(A(1,:) == 14); A = cat(1,A,zeros(1,size(A,2))); A(2,index) = 14; Added after Sean's point -- if the integer...

14 years ago | 0

| accepted

Answered
error in thresholding
soft thresholding shouldn't change the total number of coefficients. What soft thresholding will do is to change the value of th...

14 years ago | 0

Answered
matrix indexing and creating a new matrix with new size
How about clear output For f = 1:nfiles IndexStart= RHs(RHs<peak); IndexEnd= RHs(RHs>peak); output{f} =...

14 years ago | 0

| accepted

Answered
matrix indexing and creating a new matrix with new size
How about using a cell array? Beyond that I think you will need to give us a little MATLAB example to illustrate your issue.

14 years ago | 0

Answered
How to draw a discontinue function
t = 0:0.01:2*pi; x = cos(t); y = x; y(abs(x)>0.5) = 0.5; % to see the discontinuity stem(t(1:400),y(1:400)) ...

14 years ago | 0

| accepted

Answered
Hi everybody, I have a question about coherence and mscohere function
The key thing for you is to choose a window length that allows you to ensure that your frequencies of interest fall directly on ...

14 years ago | 0

| accepted

Answered
variable usage in function tf
Yes, the user will have to input some numeric value for K K = input('Enter your coefficient\n'); num = [K 1]; den ...

14 years ago | 0

Answered
How to get the row number of a row vector in a matrix
You can find the row with A =[ 1 1 2 2 2 3 3 3 4 3 ...

14 years ago | 2

| accepted

Answered
p value of f test
If you use >>format long and display the p-value does it still say 0? What is your F value and what are the numerator ...

14 years ago | 0

Answered
Convert Time Domain Signal Data into Frequency Domain, How to handle the imaginary terms?
Then you are telling me that b = [42007935 111212895 184546560 238219725 238219725 184546560 111212895 42007935]; %...

14 years ago | 2

Answered
Convert Time Domain Signal Data into Frequency Domain, How to handle the imaginary terms?
Then you want to use freqz() b = [3.91719822748777E-02, 0.103629842929331, 0.171922134825388, 0.221...

14 years ago | 2

Answered
How do i add normal error to some ideal values ?
Assume x is your error-free data x = cos(pi/4*(0:99)); % now add the error, let the standard deviation be 2 x =...

14 years ago | 1

| accepted

Answered
Convert Time Domain Signal Data into Frequency Domain, How to handle the imaginary terms?
You want to plot the magnitude and phase separately for the complex-valued data. Think of the polar form of a complex number. A ...

14 years ago | 3

| accepted

Load more