Can't understand the output of the exercise

here is the problem:-
An audio signal is sometimes stored as a list of int values. The values represent the intensity of the signal at successive time intervals. Of course, in a program the signal is represented with an array.
Often a small amount of noise is included in the signal. Noise is usually small, momentary changes in the signal level. An example is the "static" that is heard in addition to the signal in AM radio.
Smoothing a signal removes some of the noise and improves the perceptual quality of the signal. This exercise is to smooth the values in an integer array.
Say that the original values are in the array "signal". Compute the smoothed array by doing this: Each value smooth[N] is the average of three values: signal[N-1], signal[N], and signal[N+1].
For the first element of smooth, average the first two elements of signal. For the last element of smooth, average the last two elements of signal.
here is the original data for the signal array.
int[] signal  = {5, 5, 4, 5, 6, 6, 7, 6, 5, 4, 1, 4};i had to declare another array by the name of smooth.
int[] smooth Now i am having a big problem. here is the output of the program from author point of view using the original data in signal array.
C:\>java Smooth
signal: 1 5 4 5 7 6 8 6 5 4 5 4
smooth: 3 3 4 5 6 7 6 6 5 4 4 4
C:\>i got completely lost. the original signal data is replaced by a new one but how ? if i can get a more detail explanation on this problem by anyone it would be great. so i thought to assign some duke dollars if i can understand the logic not trying to be greedy but to see who is a good teacher. thanks.
once i get a good explanation i can go ahead and start coding and see if i can achieve this. i am pretty much sure it is a simple task but author made it looks like my worst nightmare.

here is the problem:-
An audio signal is sometimes stored as a list of int values. The values represent the intensity of the signal at successive time intervals. Of course, in a program the signal is represented with an array.
Often a small amount of noise is included in the signal. Noise is usually small, momentary changes in the signal level. An example is the "static" that is heard in addition to the signal in AM radio.
Smoothing a signal removes some of the noise and improves the perceptual quality of the signal. This exercise is to smooth the values in an integer array.
Say that the original values are in the array "signal". Compute the smoothed array by doing this: Each value smooth[N] is the average of three values: signal[N-1], signal[N], and signal[N+1].
For the first element of smooth, average the first two elements of signal. For the last element of smooth, average the last two elements of signal.
here is the original data for the signal array.
int[] signal  = {5, 5, 4, 5, 6, 6, 7, 6, 5, 4, 1, 4};i had to declare another array by the name of smooth.
int[] smooth Now i am having a big problem. here is the output of the program from author point of view using the original data in signal array.
C:\>java Smooth
signal: 1 5 4 5 7 6 8 6 5 4 5 4
smooth: 3 3 4 5 6 7 6 6 5 4 4 4
C:\>i got completely lost. the original signal data is replaced by a new one but how ? if i can get a more detail explanation on this problem by anyone it would be great. so i thought to assign some duke dollars if i can understand the logic not trying to be greedy but to see who is a good teacher. thanks.
once i get a good explanation i can go ahead and start coding and see if i can achieve this. i am pretty much sure it is a simple task but author made it looks like my worst nightmare.

Similar Messages

  • I have s mac book pro--I would like very much to have the output to the DVI cable --my audio(sound) wilkl nit default to DVI output  --How can this be changed

    I have a mac book pro--I would like very much to have the output to the DVI cable --my audio(sound) wilkl nit default to DVI output  --How can this be changed, so it does not default to interabnl speaker
    Is there a way to force the system to change to DVI output?????
    thanks a lot

    Hi there,
    You may find the troubleshooting steps in the article below helpful.
    Troubleshooting issues with no audio from built-in speakers on Macs
    http://support.apple.com/kb/ts1574
    -Griff W.

  • My UR12 Steinberg interface is recognized by Yosemite but I can't get any output from the device, does anyone know how to fix this problem? Thanks in advance

    My UR12 Steinberg interface is recognized by Yosemite but I can't get any output from the device, does anyone know how to fix this problem? Thanks in advance

    Apparently it's related to the Firefox plug in.
    This isn't exactly a solution but more of a way to avoid opening PDFs with Firefox's plug in.
    1. Highlight "Tools" from the Menu Bar in the top left of the screen (or click "Options" if using the Firefox Compact Menu)
    2. Select to "Options
    3. Select "Applications"
    4. Look for "Adobe Acrobat Document" under Content Type and to the right under Action select "Use Adobe Reader (default)" instead of the using Adobe Acrobat in Firefox
    5. Open a test PDF. It should open in it's own window now.
    Again, not a complete solution but something that'll at least let you scroll with PDFs open.
    More info here: http://forums.mozillazine.org/viewtopic.php?f=38&t=2171033

  • How can I disable the output of the domain name after a getent request?

    I use an iPlanet DS 4.13 to resolve the hostnames to IP-adresses in my company network. I have several scipts in use which use the getent command to resolve name to IP, but if I do a 'getent hosts hostname' I get an output like this:
    123.123.123.123 hostname.domainname
    How can I disable the output of the domainname? I just want to get back the IP-adress and the hostname?!
    Help, please?!

    The enrty in Ur DS for name to ip resolution might
    have been given in the format "hostname.domainname" for the hostname.so if U remove the domainname it would resolve to the host name only.Check the attribute field in Ur directory server where U've entered the hostname.

  • Can you change the color of the output in the console?

    When you run your program using NetBeans the color of the output in the console window is black. Is there any way to change the color of the output to say blue?

    Hi AJL,
    There is no way to color rows of the table control in a SUDialog. You could consider using the ActiveX container control and using the Microsoft ActiveX table control, which might have that functionality. Note though, that then you need to either ensure that control is always on all your client machines or make provisions for it to be installed/registered.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • To get the output  in the chart for a single selection

    Hi all,
    I used a query to get the output of the table, and for the same query i have  created a view to get the result in the chart.
    to get the output of the table for  a particular region i have created an input field and added value help to it. When i selected one particular region, i will be getting the data, in the table. But when i select a particular row in the table i need to get the data of that particular row only in the chart. (which i am getting)
    But when i select multiple regions at a time, then i am facing the issue. I get result of multiple regions data(at a time two rows are displayed in the chart) in the chart. where in i want to get data only for one region (only one row needs to get selected at a time) to get the result.
    Can any one throw a light of what needs to be done here.
    Thanks,
    Rani

    Hi Rani,
    I am not sure if I understand your question exactly, but it sounds like you need to set the selection mode for your table to "Single". If you do that the user will only have the possibility of selecting one row at a time in the table; they will not be able to select multiple rows.
    You make that setting in the Configure Element panel for the table.
    I hope this suggestions helps.
    Margaret

  • How to get the output of the Send Separate Remittance Advices in XML in R12

    Hi All,
    I have a requirement where we want the output of the standard report 'Send Separate Remittance Advices' to come in XML, currently its coming in PDF format.
    Can you please help?
    Thanks,
    Dilip
    Edited by: 990784 on Mar 12, 2013 2:57 PM

    Refer these links
    http://www.sap-img.com/bc037.htm
    http://www.members.tripod.com/abap4/Save_Report_Output_to_a_PDF_File.html
    CONVERT_ABAPSPOOLJOB_2_PDF FM convert abap spool output to PDF

  • How to send the output of the 1st BPEL process as a input to 2nd BPEL Proce

    Hi,
    I am working on OBPM 11G and my requirement is like below,
    From Mediator we need to call two different BPEL process. 1st one is Synchronous one and second one will be a one way interface. We need to call a java call out from Mediator and then give the output to the first BPEL process. The output from the first BPEL process has to be given to the second BPEL process with a filter condition.
    However we have achieved to call Java callout as well as call to two different BPEL process but facing issues in sending the output of the first BPEL process as a part of input to the second BPEL process.
    Any help on this would be appreciated.
    Bibhu

    Hi,
    Why do you need the third step, if the second step is a Numeric Limit Test step type, you can setup the limits of this step for your required limits of 11V and 12V. Your result is returned from your VI to Step.Results.Numeric which will be evaluated in the Status Expression giving you a Pass / Fail status.
    Look at the example TestStand\examples\demo\..\Computer Motherboard Test\computer.seq
    But to answer your reoriginal question, some additional information is required.
    What are your inputs and outputs assigned to in TestStand, do you use the Step properties, Locals, FileGlobals?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Make the output of the BI report rtf file some fields non editable

    Hello All,
    I want to make some fields in the output of the BI report as editable and some non editable. Any output format is fine (PDF, RTF or HTML) Please let me know if anyone knows how to do it.
    Thanks in advance..
    Anu

    You can add RTF to active allowed output type list (provided that your reporting system supports it) by going to CustomerReportExtensions.xml file and adding the following node right after ParameterTypes node:
    <ActiveReportOutputTypes configChildKey="key">
    <ActiveReportOutputType key="RTF" value="RTF" extension=".rtf"/>
    </ActiveReportOutputTypes>

  • How to hide the specified rows in the output of the report?

    Hello all,
        I have a requirement where i have to hide some of the lines (<b>initial 6 lines</b> that is <b>6 rows</b>) in the output of the report.
    How would I go about doing this?
    Thanks for you time.

    Hello Sai,
    I believe this is query output ( e.g., )
    Country   Sales
    India        $100
    USA        $200
    Germany  $300
    You want to hide the line Germany  $300
    Case 1:
        If you can change the query, Filter on Country and exclude Germany
    Case 2:
        If you can not change the query, use url appending and filter out Germany
    Check webapi reference for the exact commands
    Case 3:
        Only if you are using the NW2004s front-end, Report designer will be available for you. In this, you can delete the rows that you do not want and publish in web.
    Case 1 and 2 solutions are available in older versions of front-end as well.
    Regards,
    Sheik Bilal

  • I want to add hyperlink in the illustrator file and want the output in the PDF

    I want to add hyperlinks in the illustrator file and want the output in the PDF.
    I tried to add the multiple hyperlinks on the text and images in the illustrator by using the attribute panel but the links are not working in the published PDF.
    Is there is any other method to create a hyperlink in the illustrator?
    Can anybody help me out in this
    Thanks

    Interesting, Carlos.
    There's another method by JET: Re: hyperlinks in Ai

  • [OLAP DML] display on screen the output while the program is running

    Hi,
    I'm running a script in AWM that is quite long, and I've placed some few 'show' so that I know what the program is doing, but it won't show on the screen the outputs until the program ends. I guess it writes all the outputs in a kind of buffer and release the content of the buffer at the end of the program.
    How could I have it to release this buffer continuously?
    Thanks

    i think the relational analogy would be an anonymous pl/sql block executing a list of commands while outputting a list of useful dbms_output.put_line log statements:
    Just as with SHOW and olap worksheet cmd line, you cant see the running dbms_output log while the pl/sql program is running... you need to wait for it to complete before you can see the log.
    You can write to a file and close/exit the file each time or you can write to log table and commit each time but i guess, some such heavy lifting is needed if you want to track the long running process mid-way.
    NOTE: For regular operations like dbms_cube.build load/forecast/allocate process/steps, you can always run queries against CUBE_BUILD_LOG etc mid-way. But if it's pure olap dml actions being performed then no neat pre-built handle to check things mid-way exists.

  • To store the output of the OutputStream in the String

    I can get the output of the transformer.transform("","") to be printed on the screen, but the aim is to store the output in the String.
    I checked out the API, one way to get the data would be to store the output in the file using.....
    new StreamResult(new File("x.html")) and then get the data. But I am not suppose to use a temporary storage in the form of a file. Is there any other way I can get the data in the form of a String.
    The code is :
    File file = new File("table.xsl");
    StreamSource xslSource = new StreamSource(file);
    File file1 = new File("test.xml");
    StreamSource xmlSource = new StreamSource(file1);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(xslSource);
    target = new StreamResult(System.out);
    transformer.transform(xmlSource,target);
    Thanks in advance.
    manibhat

    Hi ecbouma,
    Thanks for the solution.
    I came across another approach..
    StringWriter sw = new StringWriter();
    PrintStream ps = new PrintStream(sw);
    sw.toString();
    It works fine...
    I have a question over here...
    PrintStream takes an argument that extends OutputStream, but looks like StringWriter does not extend OutputStream...
    I am not sure why does the above code works.
    manibhat

  • Catch the output of the WL server if WL is running as a service

    Hi,
    Is there any way to catch the output of the WLS in case it is running as an
    NT service?
    If I use the startWeblogic.cmd, I can append something like this to the
    starting command:
    [...]weblogic.Server >config\mydomain\logs\out.log 2>&1
    But it's not working for the service.
    I've tried to change the registry setting even:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\myserver\Parameters
    But when I put >filename in the registry, it stops working.If I remove the
    filename from the registry, it's ok again.I need the output as this is the only way to keep the possible JVM runtime
    errors.
    BR,
    Adam

    I forgot to mention the details:
    - Weblogic v6.1SP3
    - WinXP Prof SP1

  • EXIT/BADI  for enhancing the output of the transaction S_ALR_87013532

    Hi,
      greetings to all!! I have a problem here guys-I need to find any exit or badi for enhancing the output of the tcode S_ALR_87013532.This tcode is used for seeing the planned/actual/variance of project cost.
    In  the output we have got 3 columns-total of years, previous years and 2009. Under each column we have Plan, Actual, Variance and VAR %. Our requirement is to show Functional Location(PRPS-TPLNR), Budget Number(TCN01-SWRT0), SBU (TCN01-SWRT1) and Region (TCN01-SWRT2) in each of the clolumns-you can also get the last 3 fields in PRPS table as USR00, USR01 and USR02.
    Can anyone help please?could not find anything worthwhile on SDN. Thnx  a lot !

    Hi,
    Check   these User-Exits..
    Exit name  Short text
    KAHFEX01  Selection data for commercial reporting in PS
    KAP10001  PS: Hierarchy Reports for Projects
    KAP60001  PS: Export Project Key Figures into R/3 EIS
    Also check the BADI
    WBS_USER_FIELDS_F4
    Regards
    Raghu
    Edited by: Raghavendra  Rao G on Sep 2, 2009 12:26 PM

Maybe you are looking for

  • Early 2008 24" imac ram upgrade issues

    Hi everyone.  Hope you guys can help diagnose a problem I have with my imac. It's an early 2008 24" imac with 3.06 Ghz processor and an NVIDIA Geforce 8800 GS 512 graphics card. After buying Empire: Total War I thought it best to upgrade the 2GB RAM

  • Firefox staying offline on certain websites

    When my internet briefly disconnects and reconnects while firefox is open, firefox suddenly refuses to load certain websites, those websites (if its any help) are facebook, yahoo mail, and any google search page. These happen to be pages i access alo

  • Export to Fixed Field Spacing using TOAD....

    Hi Guys, Here's my situation. I am exporting my data-set from TOAD to a Fixed width text file, but i dont see the option to specify the length that each column should occupy. Is there any way i could do this? For example: I am running the query : Sel

  • Hide controls

    Hi I am streaming a video through IE on windows 7 x64 and i was just wondering if there is any way to hide the control bar at the bottom or set it to auto hide when I move the move over it   thanks

  • Where do I download Prime Collaboration Deployment?

    Where do I download Prime Collaboration Deployment from?