Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 537765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:57:41+00:00 2026-05-13T09:57:41+00:00

I would like to plot the greasy test signal in Matlab, and then plot

  • 0

I would like to plot the “greasy” test signal in Matlab, and then plot a Gauss function in the same plot. The script below does that.

But I would like to be able to place the Gauss function at a certain position, so I see that others often use CIRCSHIFT to move plots.

When I use it I can move the Gauss function to the left or right, but not up and down.

PGAUSS used in the script comes from the LTFAT DSP third party toolbox, but it could for debugging be any function. E.g. -x^2.

Can someone figure out, what I am doing wrong?

Here is how it looks with [0 0]
alt text http://img268.imageshack.us/img268/1130/66837635.png

Here is how it looks with [0 111]
alt text http://img684.imageshack.us/img684/2386/0111q.png

Here is how it looks with [111 0]
alt text http://img194.imageshack.us/img194/8760/1110d.png

Lots of love,
Louise

g = greasy;

fs = 16000;
Lg = length(g);

% -2441 so just get the first 500 points
L2 = floor(Lg/2)+1 - 2441;

gf = greasy;
gf = gf(1:L2);

hold on
plot (1:L2,gf);
xlabel('Time / samples');
ylabel('Amplitude');

% Contructing values to make the plot look as desired
L = 500;
tfr = 1;
cent = 300;

%gw = pgauss(L,tfr,cent)
% Here I would have expected the Gauss function to be
% moved down, but nothing happens.
gw = circshift(pgauss(L,tfr,cent), [0 -1]);
plot(gw,'Color','red');

% Multiply the signal with the Gauss window
figure(2);
plot(gf.*gw);
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:57:41+00:00Added an answer on May 13, 2026 at 9:57 am

    What you want to do is to add a constant factor to Gauss function to move it up or down.

    B = [1,2,3,4,5]

    B =

    1 2 3 4 5

    size(B)

    ans =

    1 5

    circshift(B,[2 0])

    It does nothing because B has only one row, so this row returns to its original position regardless of value of rowshift

    ans =

    1 2 3 4 5

    circshift(B,[0 2])

    ans =

    4 5 1 2 3

    B + 5

    ans =

    6 7 8 9 10

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to plot y1 and y2 in the same plot. x <-
I would like to create 10 plots that have different data, but the same
in python, I would like to use: from pylab import * Then use plot
I would like to make a script that outputs only the real time value
I would like to plot discrete values in MATLAB like this: stairs() and stem()
I would like to reuse a figure I create in Matlab script. fig1 =
I would like to plot an implicit function of x and y: 1 -
I would like to plot a decomposition tree in Mathematica. I have a function
When plotting a function using Plot, I would like to obtain the set of
I would like to test a string containing a path to a file for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.